JPEG XL now works by default in Chrome and Firefox. We measured it on 16 photos
In October 2026, two things happened within a week. Chrome 155 (6 October) started decoding JPEG XL by default, and Firefox 158 (13 October) followed. Safari has shown .jxl files since version 17, back in 2023. After yea
In October 2026, two things happened within a week. Chrome 155 (6 October) started decoding JPEG XL by default, and Firefox 158 (13 October) followed. Safari has shown .jxl files since version 17, back in 2023. After years of "JPEG XL is great, but nothing opens it", three of the four big browsers now do.
Before putting .jxl files on a website, we wanted our own numbers rather than the ones that get passed around. So we ran two tests on 16 public-domain photos and measured size, quality and CPU time. Here's what came out, and how we'd ship it.
Where JPEG XL works (late November 2026)
| Where | JPEG XL |
|---|---|
| Chrome | By default since 155, 6 Oct 2026 (Chrome Platform Status) |
| Firefox | Since 158, 13 Oct 2026 (release notes) |
| Safari | Since 17 (2023), without progressive loading or animation |
| Edge | No, even though it's Chromium. Edge 155's release notes announced it and Microsoft removed the line a day later; MDN now says not supported as of 156 |
| Windows 11 | With Microsoft's free JPEG XL Image Extension (24H2 or later) |
| Android | Not in the system's list of supported formats; Chrome shows it inside web pages |
So JPEG XL is viable on the web with a fallback, not instead of one.
Test 1: re-packing the JPEGs you already have
cjxl has a trick that JPEG optimisers don't. Given a JPEG, by default it doesn't decode and re-compress it: it re-encodes the JPEG's own data with better entropy coding, so not a single pixel changes, and it keeps enough information to rebuild the original file exactly.
cjxl photo.jpg photo.jxl # lossless re-pack: the default for JPEG input
djxl photo.jxl back.jpg # rebuilds the original JPEG
sha256sum photo.jpg back.jpg # same checksum
We ran it on 16 JPEGs exactly as they were uploaded to Wikimedia Commons, all CC0: seven from phones (iPhone 12 and 13, Pixel 7, Galaxy S21 Ultra) and nine from Fujifilm, Canon, Olympus, Nikon and Sony cameras, between 7.8 and 26.8 megapixels.
- 101.53 MB became 80.56 MB: 20.7% smaller overall, from 11.1% to 28.9% per photo (median 19.0%).
- All 16 came back bit for bit: same SHA-256, metadata included.
- Effort 9 instead of the default 7 gave 20.9% instead of 20.7%, for about eight times the CPU time. Keep the default.
Against the classic lossless JPEG optimisers, on the 13 photos with nothing appended after the image:
| Method | Saved | What you get |
|---|---|---|
jpegtran -optimize |
5.2% | Still a JPEG, but not the original file |
jpegtran -progressive |
9.5% | Still a JPEG, but not the original file |
cjxl (default) |
21.5% | A .jxl, from which the original JPEG is rebuilt byte for byte |
The trap: HDR gain maps and motion photos
Modern phone JPEGs often carry extra data after the main image: an Ultra HDR gain map on the Pixel, Apple's own HDR gain map on an iPhone running iOS 26, or the short video of a Motion Photo. cjxl keeps all of it, which is why the round trip stays bit-exact, but it can only re-pack the main image. So those files save less: the Pixel photo with a video inside saved just 11.1%.
jpegtran looks much better on that same photo, "saving" 50.7%. It does that by silently throwing away the gain map and the video, while leaving the metadata that says they exist. If you run lossless optimisers over a library of phone photos, check what they do with these extras first.
Test 2: same visual quality, how many bytes?
Comparing "quality 80" in one encoder with "quality 80" in another means nothing, because the scales are unrelated. So we matched quality with a perceptual metric instead. Each photo was resized to 2048 px on the long side, encoded at many settings with libjpeg-turbo, Google's jpegli and cjxl, decoded, and scored against the reference with SSIMULACRA2. Then we interpolated the file size each encoder needs to reach the same score.
Median sizes, scaled to a 3.1-megapixel picture:
| SSIMULACRA2 score | libjpeg-turbo (4:2:0) | jpegli | JPEG XL |
|---|---|---|---|
| 70 ยท high quality | 339 KB | 292 KB | 239 KB (โ22% vs jpegli) |
| 80 ยท identical side by side | 529 KB | 469 KB | 382 KB (โ20%) |
| 85 ยท identical when flipping | 792 KB | 664 KB | 535 KB (โ23%) |
| 90 ยท visually lossless | 1,373 KB* | 1,289 KB | 964 KB (โ24%) |
*Only 13 of the 16 photos reached 90 at all with libjpeg-turbo's default 4:2:0 colour subsampling.
JPEG XL produced the smaller file in every single comparison: 80 out of 80 against jpegli and 77 out of 77 against libjpeg-turbo. Against libjpeg-turbo, which is what most software uses, the median saving was 28% to 33%. jpegli closes part of that gap, but JPEG XL still needed 20% to 24% fewer bytes. That's more modest than some figures you'll read online, and it's what our photos showed.
The gap depends a lot on the picture. At a score of 80, the swans against a blue sky and the poppy against clouds needed less than half the bytes of libjpeg-turbo, and about 40% fewer than jpegli. Dense, detailed scenes still came out 14% to 16% smaller than jpegli. JPEG has nowhere to hide on a flat sky.
If you'd rather have settings than scores: a score of 80 took a median quality of 83 in libjpeg-turbo and jpegli, and a distance of 1.6 in cjxl. A score of 85 took quality 91 and distance 1.0, which is exactly cjxl's default for non-JPEG input.
The cost: CPU time
JPEG XL saves bytes by working harder. To reach a score of 80, on one core:
- libjpeg-turbo: 0.04 s of CPU per megapixel
- jpegli: 0.06 s per megapixel
-
cjxlat its default effort: 0.77 s per megapixel, roughly 13 to 20 times more
Decoding is closer: 0.019 s per megapixel for djpeg against 0.049 for djxl, about 2.5 times. The lossless re-pack is cheap, at 0.12 s per megapixel. In a build step that's nothing to worry about; if you resize tens of thousands of images on the fly, budget for it.
Shipping it today
1. Always with a fallback. Edge and older browsers skip the image/jxl source and load the JPEG:
<picture>
<source srcset="photo.jxl" type="image/jxl">
<img src="photo.jpg" alt="โฆ" width="1600" height="1067" loading="lazy">
</picture>
2. Serve .jxl with the right Content-Type. On our Ubuntu 24.04 server, the mime.types that ships with nginx 1.24 has no entry for .jxl, so the files go out as application/octet-stream. We tested what that does in Chrome 158. Inside an <img> or a <picture>, the image still shows, because Chrome sniffs it. But open the image URL directly and Chrome downloads the file instead of showing it. The fix is one line in the types { } block of /etc/nginx/mime.types:
image/jxl jxl;
On Apache, AddType image/jxl .jxl does the same.
3. Generate the .jxl in your build, and keep the JPEG.
# a JPEG you already have: lossless re-pack (the default)
cjxl photo.jpg photo.jxl
# a PNG or an edited export: lossy, at cjxl's default distance of 1.0
cjxl photo.png photo.jxl
4. If you need to know in JavaScript, a tiny embedded JPEG XL image does the job. We checked that this returns true in Chrome 158 and false with a corrupted image:
function supportsJxl() {
return new Promise((resolve) => {
const img = new Image();
img.onload = () => resolve(img.width > 0);
img.onerror = () => resolve(false);
img.src = 'data:image/jxl;base64,/wrJBQOICQgA0wcAAAgAAHwASxiLFQDUiHF3Y9w9wBAAkQDATZ2NGhYLTvfx/QXrEwgA0wcAAAQAdABLGIsVANSIMW7cjXuAIcCJexuCji7t0uHI1T8URg==';
});
}
When JPEG is still the right call
- Sending images to people (email, chat, upload forms): JPEG is the one format you can be sure the other side opens.
- When CPU time matters more than bytes: JPEG encodes and decodes several times faster.
-
HDR phone photos: re-pack them if you like, but the gain map is stored as-is, so the saving is smaller. And never run them through
jpegtran.
How we measured
A shared Ubuntu 24.04 server with 6 virtual AMD EPYC cores; libjxl 0.12.0, libjpeg-turbo 2.1.5, jpegli built from its repository at commit 031a007 (June 2026) and ImageMagick 6.9.12. Times are CPU time (user plus system), single-threaded where the tool allows it, so treat them as ratios rather than absolute figures. Sixteen photos is a small sample, not a study, and SSIMULACRA2 was developed by the same people who built JPEG XL: a different metric or a panel of viewers could rank things differently.
The per-photo tables, every command and links to all 16 photos are in the full write-up: JPEG XL vs JPEG, measured on 16 photos.
Disclosure: I run jpegxlconvert.com, a free converter and viewer that works entirely in the browser, so nothing gets uploaded. If you want to see what your own browser supports, there's a JPEG XL browser test there too.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.