When you put an emoji on a web page as text, your server doesn't draw it. The visitor's device does, with whatever emoji font it has. A phone that hasn't been updated for a few years draws a newer emoji as an empty box, or as two older emoji side by side. Nobody gets an error message.
That matters most in two places. One is emoji pickers: if yours offers π«« cracking face (new in Emoji 18.0) to someone whose device can't draw it, they pick a box. The other is emoji favicons. An SVG favicon that contains the emoji as text is drawn by the visitor's font too. You can see this in the SVG that EmojiFavicons returns for /rocket. It's a small <text> element with π in it, so every browser draws its own rocket.
Browsers have no "can you draw this?" API, so the usual trick is to draw the emoji on a hidden canvas and inspect the pixels. I wanted to know how well that trick works and what it costs. On 21 November 2026, I ran three variants against all 3,963 fully-qualified emoji in Unicode's emoji-test.txt (Emoji 18.0), with four different font setups.
The setup
- Browser: Chrome 156, headless, on a Linux VM (8 vCPU Xeon). I didn't test Firefox, Safari, Windows, macOS or phones. More on that at the end.
-
Emoji list: the 3,963 lines marked
fully-qualifiedin emoji-test.txt, each with the Emoji version it arrived in. -
Four font setups, switched with fontconfig so Chrome could only see the fonts I gave it:
- Today: Noto Color Emoji 2.051 (the current Debian package). It covers Emoji 17.0.
- Old: Noto Color Emoji 2.034 from November 2021 (Emoji 14.0), downloaded from the noto-emoji releases.
- Older: a Noto Color Emoji build from April 2020, tagged for Unicode 12.1.
- No emoji font: only DejaVu, which has black-and-white versions of some symbols.
Every check ran three times per setup. I report the median time.
Three ways to ask the canvas
All three draw the emoji at 32 px on a small canvas with the same font stack your page uses, then look at the result.
const ctx = document.createElement('canvas').getContext('2d', { willReadFrequently: true });
ctx.canvas.width = ctx.canvas.height = 40;
ctx.font = '32px "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif';
ctx.textBaseline = 'top';
function pixels(e) {
ctx.clearRect(0, 0, 40, 40);
ctx.fillText(e, 0, 0);
return ctx.getImageData(0, 0, 40, 40).data;
}
function hasColour(d) { // any pixel that isn't black, white or grey
for (let i = 0; i < d.length; i += 4)
if (d[i + 3] && Math.max(d[i], d[i + 1], d[i + 2]) - Math.min(d[i], d[i + 1], d[i + 2]) > 30) return true;
return false;
}
const hash = (d) => d.reduce((h, v) => (h * 31 + v) | 0, 0);
const TOFU = hash(pixels('\u{10FFFD}')); // a code point no font draws: the "missing glyph" box
const ONE = ctx.measureText('\u{1F600}').width; // width of one emoji
- A. Colour test. If any pixel is coloured, assume the emoji was drawn. This is the version you'll find most often.
-
B. Colour + one glyph. Same, but also require the text to be about one emoji wide (
measureText(e).width <= ONE * 1.4). When a font doesn't know a ZWJ sequence such as π¦βπ₯ phoenix, it draws the parts, π¦ and π₯, so the result is twice as wide. - C. Not the box + one glyph. Don't look at colour at all. Compare the pixels with the missing-glyph box, and check the width.
What each check said
"Should draw" is the number of emoji up to the font's Emoji version. The 2020 build turned out to be incomplete (more below), so I left that cell empty.
| Font setup | Should draw | A: colour | B: colour + one glyph | C: not the box + one glyph | C: time for all 3,963 |
|---|---|---|---|---|---|
| Noto 2.051 (today) | 3,944 | 3,862 | 3,862 | 3,944 | 445 ms |
| Noto 2.034 (Emoji 14.0) | 3,624 | 3,850 | 3,590 | 3,640 | 359 ms |
| Noto, April 2020 | n/a | 3,632 | 2,968 | 3,062 | 290 ms |
| No emoji font | 0 | 0 | 0 | 1,275 | 41 ms |
A and B took roughly the same time as C (270β360 ms with a font, 30β50 ms without).
On today's font, C was exact: it found all 3,944 emoji up to 17.0 and rejected all 19 from Emoji 18.0, which this font doesn't have yet. The others went wrong in instructive ways.
The colour test hides emoji that have no colour. With today's font, A rejected 82 emoji that drew perfectly well: π€ black heart, π€ white heart, π©Ά grey heart, π¬ speech balloon, π thought balloon, π³οΈ hole, and, with the older fonts, the grey πΊ wolf and π¦ raccoon. Their pixels are all black, white or grey, so they look like a missing glyph to a colour test.
The colour test lets broken sequences through. With the 2021 font, A said yes to 276 emoji the font doesn't have, and 265 of them were ZWJ sequences that fell apart into coloured pieces. π¦βπ₯ phoenix drew as a bird next to a flame. πββοΈ head shaking horizontally drew as two separate pieces. Both pieces are coloured, so a pixel test passes. Only the width check catches it, which is why B and C agree here and A doesn't.
"Not the box" is fooled by a black-and-white font. With no emoji font installed, C said yes to 1,275 emoji, because DejaVu has plain line drawings for many of them, including π. That's a symbol, not the emoji your design expects. The fix is one extra test up front: if π has no colour, there's no emoji font, so treat everything as not drawable.
One more trap: flags. π¨πΆ flag: Sark (Emoji 16.0) passed every test on both old fonts. It was one glyph, coloured, and not the box. In a screenshot it was Noto's placeholder, a white flag with a question mark. Comparing against a made-up flag, π½π½, catches that.
The check I'd ship
Putting the lessons together:
const HAS_EMOJI_FONT = hasColour(pixels('\u{1F600}'));
const UNKNOWN_FLAG = hash(pixels('\u{1F1FD}\u{1F1FD}')); // "XX" isn't a country
function canDraw(e) {
if (!HAS_EMOJI_FONT) return false;
if (ctx.measureText(e).width > ONE * 1.4) return false; // fell apart into pieces
const h = hash(pixels(e));
return h !== TOFU && h !== UNKNOWN_FLAG;
}
Run on all 3,963 emoji, it took 290β460 ms per run on this machine (median per font setup: 459, 318 and 291 ms, and next to nothing with no emoji font, where it stops at the first line). That's fine once, in the background, but it's too slow to do every time the picker opens, and a low-end phone will be slower than a server CPU (I didn't measure one).
The shortcut: one emoji per version
Most emoji fonts are updated one Emoji version at a time, so you can test a single new emoji from each version and assume the rest follow:
const SENTINELS = [[1, 'π'], [11, 'π₯'], [12, 'π¦©'], [12.1, 'π§βπ¦―'], [13, 'π«'], [13.1, 'πΆβπ«οΈ'],
[14, 'π« '], [15, 'π«¨'], [15.1, 'π¦βπ₯'], [16, 'π«©'], [17, 'π«ͺ'], [18, 'π««']];
const maxVersion = () => SENTINELS.reduce((v, [ver, e]) => (canDraw(e) ? ver : v), 0);
That took about 1 ms. It picked 17, 14, 12 and 0 for the four setups, and it never showed an emoji that didn't draw. But it was too strict:
- With the 2021 font it hid 15 emoji that drew fine, all skin-tone versions of π€Ό people wrestling. Unicode only listed those in Emoji 17.0, but this Noto font already drew them in 2021.
- With the 2020 build it hid 51. That build fails the 12.1 sentinel, π§βπ¦― person with white cane: it draws a person and a separate cane. But it does draw 30 of the 168 Emoji 12.1 emoji, mostly couples with mixed skin tones such as π§π»βπ€βπ§πΏ, plus five skin-tone handshakes π€π» from Emoji 14.0 and the same 15 wrestlers. The 51st was β§οΈ transgender symbol, which DejaVu drew in black and white.
canDraw()wrongly accepts that one too (more below).
Both: the sentinel first, then test only what's newer
The version check is right about everything it lets through. So use it for that part, and run canDraw() only on emoji newer than the version it found:
function drawableList(list) { // list: [{ e: 'π« ', v: 14 }, ...] from emoji-test.txt
const v = maxVersion();
return list.filter((x) => x.v <= v || canDraw(x.e));
}
In my runs this gave exactly the same answers as testing all 3,963 one by one, in every setup, in a fraction of the time:
| Font setup | Version found | Emoji tested one by one | Drawable | Time (median) |
|---|---|---|---|---|
| Noto 2.051 | 17 | 19 | 3,944 | 1.9 ms |
| Noto 2.034 | 14 | 339 | 3,639 | 3.3 ms |
| Noto, April 2020 | 12 | 953 | 3,061 | 8.7 ms |
| No emoji font | 0 | 3,963 (all fail fast) | 0 | 0.3 ms |
The numbers stay small even with the older fonts, because most unsupported emoji fail on the cheap width check before any pixels are read.
Two practical notes. Cache the result, for example in localStorage keyed by navigator.userAgent, and run the check again when the browser version changes. And draw with exactly the same font string as your picker. If the picker uses a web emoji font and the canvas uses the system one, you are testing the wrong font.
What to do with an emoji that can't be drawn
- In a picker: hide it, or show it greyed out with a short note ("may not display on this device"). Hiding is simpler. Greying out is kinder when people share content across devices, because the person reading may have a newer phone than the person writing.
-
In a favicon: an SVG favicon with an emoji in a
<text>element is drawn by the visitor's font, so the same check applies. If the emoji you want is newer than a lot of your visitors' devices, use a picture instead of text. EmojiFavicons'?pngoption returns a pre-rendered image./phoenix?pnggave me a 72Γ72 PNG of π¦βπ₯, and that doesn't depend on the visitor's font at all. Our earlier 5-minute favicon health check covers the other half: making sure the right files are served at all. - When you're choosing one: the FindUtils Emoji Finder searches by keyword and copies an emoji as a character, code point or ready-made favicon tag. Check the result on the oldest device you care about before it goes into a logo or a launch post.
What I didn't test
- Other browsers and systems. Apple Color Emoji, Segoe UI Emoji on Windows and Samsung's font all have their own coverage and their own placeholder glyphs. Firefox and Safari may also render canvas text a little differently. The approach should carry over, but the 1.4Γ width margin and the colour threshold are tuned to what I saw in Chrome.
- Real phones. The timings come from a VM. Relative costs (1 ms vs 300+ ms) matter more than the absolute numbers.
-
Symbols a text font can draw. One false yes was left in my runs: on the 2020 build, β§οΈ was drawn in black and white by DejaVu, and
canDraw()accepted it, because it was one glyph and not the box. If that matters for your picker, keep a short list of symbol-like emoji and require colour for those, accepting that a few truly black-and-white emoji (π€, π³οΈ) then need an exception. -
Fonts loaded as web fonts. If you ship your own emoji font with
@font-face, check that it has loaded (document.fonts.ready) before you run the check.
Checklist
- Don't trust a colour-only test: it hides black, white and grey emoji and lets broken ZWJ sequences through.
- Check the width as well, so an emoji that falls apart into pieces counts as unsupported.
- Check for an emoji font first (π should have colour).
- Compare against a made-up flag to catch placeholder flags.
- Find the version with one emoji per release, then test only the newer emoji one by one.
- Cache the answer per browser version, and use the picker's own font string.
The test scripts are small: a list parser, one HTML page and a Playwright runner. If you want to try the favicon side first, the EmojiFavicons docs list the SVG and PNG options.
Need help with a project? The team behind FindUtils takes on freelance work on Upwork, including Flutter apps for iOS and Android built from your idea or design, down to details like an emoji picker that only offers what the device can draw.
Top comments (2)
I'd been treating "any coloured pixel" as good enough, but this shows why it isn't. π€, π€ and π¬ are drawn correctly and still fail a colour test because they're grey, while a missing ZWJ sequence like π¦βπ₯ can pass because the fallback pieces are both coloured. The width check belongs in the same function, not as an optional extra.
The flag case is the one I would have missed. On the older Noto fonts, the Sark flag is still one coloured glyph (the white flag with a question mark), so it isn't tofu and it isn't wide. Comparing the pixel hash to π½π½ is a clean way to catch that placeholder.
The sentinel-then-only-test-newer path is what I'd actually put in a picker. 445 ms for the full set is a useful benchmark, but 2β9 ms with the same answers is the difference between running it when the picker opens and having to always cache it. I'd still cache on
navigator.userAgentand redraw with the exact font stack the picker uses.Thanks, Colin, that's a great summary. Agreed that the width check belongs in the same function, and caching per user agent while drawing with the picker's exact font stack sounds like the right default. Glad the flag placeholder check was useful.