Image Formats
Converting Images to JPEG XL: The Practical Guide for 2026
16 min read · Published June 26, 2026 · Updated November 17, 2026
JPEG XL promises better compression than JPEG, WebP, and often AVIF, lossless JPEG archiving, HDR support, and progressive rendering. As of October 2026 it decodes by default in Chrome 155 and later and in Firefox 158 and later, and in Safari 17 and later for still images; the catch is that installed browsers, Edge and everything outside a browser lag behind, so a fallback still matters. This guide covers the benchmarks, every meaningful conversion path, honest browser support, and how to set up a <picture> fallback that actually works.
Published June 26, 2026 by the Mochify Engineering Team. Covers JPEG, PNG, and AVIF-to-JXL workflows, with compression data from Google's image coding benchmarks and our own 44-image encoder test, and practical guidance on when JXL is and isn't production-ready.
What JPEG XL Actually Is (and Why the Name Is Confusing)
JPEG XL (extension .jxl) is not a direct update to classic JPEG the way that phrasing implies. It is a completely new codec, standardized by the JPEG committee as ISO 18181, with a different architecture underneath. The "JPEG" in the name refers to the committee, not the format family.
Two properties make JXL genuinely unusual among modern formats. First, it can losslessly transcode an existing JPEG into a JXL container that is smaller but still allows exact byte-for-byte reconstruction of the original JPEG - you shrink the file without losing the source. Second, it supports up to 32-bit per channel color depth and HDR (PQ and HLG), making it the strongest archival format in this comparison for professional photography workflows.
Compare that to AVIF, which tops out at 12-bit depth. Both WebP and AVIF are strong choices for web delivery today, but for long-term archival of high-bit-depth stills, JPEG XL's spec headroom is a real advantage.
Browser and Ecosystem Support in 2026
JPEG XL has been natively supported in Safari 17 and above (announced at WWDC 2023) for still images, covering all up-to-date macOS and iOS devices; Safari does not decode animated JXL or render progressively. Until October 2026 that Safari share, roughly 14–17% of global browsing, was the whole installed base, which is why this guide treated JXL as an Apple-audience format. That changed on October 6.
Chrome's history with JXL is worth knowing because it explains where things stand now. Chromium shipped early JPEG XL support behind a flag in versions 91–109, then removed it entirely in Chrome 110 citing "lack of ecosystem momentum." In late 2025 and early 2026, Google reversed course: a Rust-based JXL decoder (jxl-rs) was merged into Chromium's rendering pipeline. Chrome 145 to 154 exposed it via chrome://flags/#enable-jxl-image-format, disabled by default. Chrome 155, released on October 6, 2026, enables it by default on Windows, macOS, Linux, ChromeOS and Android, with no flag; Google's announcement, "Shipping JPEG XL in Chrome", explains the Rust decoder and the memory-safety reasoning. Installed browsers take weeks to update, so for the rest of 2026 a share of Chrome traffic is still on 152 to 154.
Firefox enables JPEG XL by default from Firefox 158, released on October 13, 2026, with animation and progressive display; Firefox 157 does not, despite Mozilla's August intent to ship naming it. Edge, Samsung Internet and the other Chromium-based browsers had not shipped the change as of October 7, 2026, and Microsoft has made no statement. Check caniuse.com/jpegxl for the live row before you drop a fallback.
CDN and platform support follows the same split. Fastly Image Optimizer supports JPEG XL as both input and output. Cloudflare Images and Netlify Image CDN do not yet support JXL as an output format. Imgix accepts JXL as input but only serves AVIF or WebP as output. Major CMSes - WordPress core and Shopify - do not expose JXL in their upload or delivery pipelines: WordPress 7.1's client-side media pipeline outputs JPEG, PNG, WebP, AVIF and GIF, and Shopify's accepted upload formats are JPEG, PNG, GIF, HEIC and WebP. Browser support arriving does not change either of those until the platforms add an encoder.
Compression Benchmarks: How Much Smaller?
JPEG XL's compression efficiency is well-documented in peer-reviewed testing. The JPEG XL next-generation image compression architecture paper from Google covers the codec's design goals and efficiency in detail. Here is what the numbers say across three scenarios.
Lossy: JPEG XL vs JPEG
For typical photographic content, a lossy JPEG XL re-encode at comparable perceptual quality produces files 30–55% smaller than legacy JPEG. The upper end reflects high-effort encoder settings; a practical web preset sits closer to 35–45%. Google's Image Coding Comparisons tool shows JPEG XL consistently outperforming JPEG and WebP at equivalent subjective quality across a broad range of photographic test sets.
JPEG XL vs AVIF is tighter. Cloudinary image researcher Jon Sneyers, analyzing the same benchmarks with practical encode presets (JXL s6 vs AVIF s7), found that 9 out of 13 quality metrics favoured JPEG XL on photographic datasets - a useful read on a competitive comparison.
Lossless: JPEG XL vs PNG
PNG has been the default lossless format for web graphics for decades. JPEG XL lossless is a meaningful upgrade. Community benchmarking across hundreds of images found that JPEG XL lossless at effort=1 (very fast) produced files roughly 19–25% smaller than PNG at PNG's own maximum compression, while encoding around 150 times faster. At higher effort settings, JPEG XL lossless can be 40–50% smaller than PNG - at the cost of much slower encoding. For archival use where you run the encoder once and store the result, high-effort settings are often worth it. JPEG XL also supports full transparency in both lossy and lossless modes, making it a viable PNG replacement for logos, sprites, and UI assets. For a measured example on one real macOS screenshot, 46% smaller with every pixel checked, see JPEG XL vs PNG for screenshots. For how lossless JPEG XL compares with lossless WebP, PNG and AVIF across six image types, and when lossless is the wrong choice altogether, see which lossless image format to use.
Lossless JPEG archiving
This is JPEG XL's most distinctive feature. Existing JPEG files can be transcoded into a JXL container that allows exact byte-for-byte reconstruction of the original JPEG. The EPFL/Google benchmarking paper puts the average storage reduction for this reversible transcoding at 22% across broad test sets, with Apple's WWDC documentation noting up to 60% reduction on some photographic datasets at higher settings.
For large JPEG archives - e-commerce product catalogs, photo libraries, stock collections - converting JPEG to JXL in lossless-transcode mode gives you 20–40% storage savings while preserving the ability to reconstruct the original JPEG exactly. That is a hard-to-argue-with value proposition for archival pipelines, independent of browser support.
Which Encoder and Settings? What We Measured
The encoder you use, and how hard you let it work, changes JPEG XL file sizes almost as much as the format choice does. In our November 2026 run on 44 images, libjxl's default (effort 7) was the right baseline, effort 9 saved nothing on photos, and a newer Rust encoder, jixel, made files 21% smaller at the same measured quality on its Medium setting while taking about 45% longer to encode.
Most people never see these settings, because a converter picks them. They matter once you run your own pipeline, or when two tools give you very different file sizes for "the same" JPEG XL.
Three words this section uses
- Encoder: the program that turns pixels into a .jxl file. Any conforming decoder reads every JPEG XL file the same way, but two encoders can make very different files from the same picture. libjxl is the reference encoder (its command-line tool is
cjxl); jixel is a newer encoder written in Rust, used as a library from code. - Effort: how long the encoder searches for a smaller file. In libjxl it runs from 1 (fastest) to 10, and the default is 7. More effort costs encoding time; it does not lower quality.
- Distance: the quality target. 0 is lossless, 1.0 is meant to look identical to the original, and higher numbers give smaller, softer files. Two encoders do not mean the same thing by the same number, which is why we compared files at equal measured quality, never at equal settings.
How we tested
We encoded 44 images with libjxl 0.13.0 at efforts 1, 3, 7 and 9, with libjxl 0.11.2 at effort 7 for comparison, and with jixel 0.5.10 at its Fast (default), Medium and Slow speeds: 24 photos from the Kodak test set, 9 UI screenshots, 6 charts and line drawings, and 5 images with transparency. Each image went through six quality levels, was decoded with libjxl's djxl, and was scored against the original with three quality metrics: SSIMULACRA2, Butteraugli and DSSIM. For every image we then compared file sizes at the same score across the range both encoders reached.
The metric matters. jixel tunes its output against SSIMULACRA2, and libjxl's distance scale is built on Butteraugli, so the figures below use DSSIM, which belongs to neither project. All three metrics pointed the same way. Everything ran on one CPU thread on a two-core cloud machine, with transparency kept lossless on both encoders. The screenshots, charts and transparent images are small sets made for this test (the nine screenshots are six pages, three of them also captured at double resolution), so read their percentages as a direction, not a precise figure. The 24 photos are the firmer result.
The results: file size at equal quality
Each figure is the file size against libjxl 0.13.0 at effort 7 for the same DSSIM score. Negative means smaller.
| Setting | Photos | Screenshots | Charts and line art | Transparent | All 44 | Encode speed (MP/s, one thread) |
|---|---|---|---|---|---|---|
| libjxl effort 1 | +9% | +98% | +22% | +49% | +30% | 15.9 |
| libjxl effort 3 | 0% | +63% | 0% | +28% | +14% | 14.5 |
| libjxl effort 7 (default) | baseline | baseline | baseline | baseline | baseline | 2.1 |
| libjxl effort 9 | 0% | +11% | 0% | -10% | +1% | 0.43 |
| jixel Fast (default) | -13% | +40% | -39% | +14% | -6% | 3.3 |
| jixel Medium | -14% | -13% | -57% | -15% | -21% | 1.45 |
| jixel Slow | -17% | -58% | -63% | -32% | -36% | 0.14 |
What the table says, in order of how much it should change what you do:
- Keep libjxl at effort 7. Effort 9 encoded five times slower (0.43 against 2.1 megapixels a second) and came out within 1% overall; on our screenshots it made files 11% larger. Efforts 1 and 3 are seven times faster but cost 14% to 30% overall and up to double on screenshots.
- The encoder matters more than the effort. jixel Medium made files 21% smaller than libjxl's default while taking about 45% longer to encode (1.45 against 2.1 megapixels a second). jixel Slow made them 36% smaller, but at 15 times the time, which only pays for images you encode once and serve for years.
- Check the defaults before you trust a headline. jixel's default speed, Fast, made screenshots 40% larger than libjxl did. The gains above come from its slower settings.
- Photos gain least, screenshots and graphics most. On photos jixel's saving was 13% to 17% on DSSIM and 6% to 10% on Butteraugli; on charts and screenshots its Medium and Slow settings saved 13% to 63%.
- Re-test after an upgrade. On our nine screenshots, libjxl 0.11.2 at effort 7 made files 13% smaller than 0.13.0 at the same quality; photos did not change. Nine images is a small set, so measure your own before and after.
A worked example: one dashboard screenshot
Take a 1280 x 800 screenshot of a web dashboard: dark sidebar, white cards, large numbers, small gray labels. Encoded with libjxl 0.13.0 at distance 1.0 and effort 7, it came out at 61,135 bytes with a SSIMULACRA2 score of 89.5. jixel Slow at distance 1.0 produced 26,298 bytes scoring 89.7, and its DSSIM score was better too: the same picture to both metrics, 57% smaller.
Now the trap. On one of the Kodak photos (768 x 512, two parrots), the same distance 1.0 gave 56,733 bytes from libjxl scoring 87.6, and 37,214 bytes from jixel scoring 84.9. That smaller file is also a lower-quality one. Comparing encoders by their settings instead of by a measured score is how most "encoder X is 30% better" claims go wrong.
Lossless and JPEG recompression
For lossless output, libjxl at effort 9 was 7% smaller than effort 7 for three times the encoding time, jixel Medium was 17% smaller and jixel Slow 25% smaller (55% on screenshots), while jixel Fast was 33% larger. Every one of the 308 lossless files decoded back to the exact original pixels.
Lossless JPEG recompression, the reversible mode described in the next section, was a tie. Both encoders shrank 24 photos saved as quality-85 JPEGs by 14% and 9 screenshot JPEGs by 31% to 34%, and every file rebuilt the original JPEG byte for byte. Your saving depends on the JPEG you start from: ours were written with optimized Huffman tables, which leaves less to win than the 22% average from the EPFL and Google study above.
Do the files open everywhere?
Every file from both encoders decoded to the same image, within a few levels of rounding, in libjxl's djxl and in jxl-rs, the Rust decoder that ships in Chrome. A third decoder, jxl-oxide, showed visible errors on 5 of the 264 jixel files we checked, and on none of libjxl's. It is not settled whether jxl-oxide or jixel is at fault; if the apps your audience uses are built on jxl-oxide, test before you switch encoders.
Which should you use?
- Converting a handful of files: you do not need to choose. A converter picks the encoder and settings for you; the PNG to JXL converter uses one high-quality setting with nothing to set, or a pixel-exact copy if you switch Lossless on after uploading.
- Your own pipeline with libjxl: leave effort at 7 and set quality with distance, for example
cjxl input.png output.jxl -d 1 -e 7. For lossless, use-d 0. For a JPEG you might need back,cjxl photo.jpg photo.jxltranscodes reversibly by default, anddjxl photo.jxl photo-restored.jpgreturns the original file. - Screenshots, UI and graphics you encode once: jixel Medium or Slow is worth a trial if you build in Rust, with a check in the decoders your audience uses.
- When none of this is needed: if browser support, not bytes, is what holds JPEG XL back on your site, a better encoder changes nothing. Get the fallback right first.
To check a result yourself rather than trust a setting: decode it with djxl output.jxl check.png, then run dssim original.png check.png. A score of 0 means identical, and smaller is better. Compare two encoders at the same score, then look at the file sizes.
Converting JPEG to JPEG XL
Converting JPEG to JPEG XL has two distinct modes, and which one is right depends on your goal.
Lossless transcode mode wraps the original JPEG data inside a JXL container with no re-encoding. You retain bit-for-bit reconstructability of the source file, and you typically see 20–30% file size reduction. This is the right choice for archival use and for any pipeline where you might need the original JPEG again downstream - legacy systems, social preview generation, ad networks.
Lossy re-encode mode fully decodes the JPEG and re-encodes to JXL at the target quality. You get larger savings - 40–60% vs the original JPEG at similar perceptual quality - but you are making a generation copy. If the source JPEG was already lossy, you are stacking artifacts. This is the right choice when you have access to the raw source (a TIFF, a RAW export, or a lossless master) and are producing a fresh JXL for serving.
For web delivery from October 2026, JPEG-to-JXL serves Safari, Chrome 155+ and Firefox 158+ users, a share that grows weekly as installed browsers update. The baseline JPEG remains the universal fallback.
You can convert to JPEG XL directly with the JPG to JXL converter: drop the files and it re-encodes them with one high-quality setting, nothing to set. It is a re-encode, not the reversible JPEG transcode described above, so keep your JPEG masters. For batch workflows, the CLI and MCP routes are covered in the Mochify Workflow section below.
Converting PNG to JPEG XL
PNG is overused as a web format because it is the default export from many design tools, not because it is the right choice for most images. JPEG XL gives you two options to improve on it.
For photographic PNGs (PNG exports of photos, which are common from Figma and similar tools), lossy JPEG XL typically cuts file size by 60–80% at similar visual quality. The format's VarDCT mode handles photographic content the same way AVIF or WebP do - much better than PNG's lossless model.
For graphics, illustrations, UI elements, and transparent assets, JPEG XL lossless is the right mode. You keep the transparency, the sharp edges, and the exact pixel data. The compression win over PNG (19–50% depending on encoder effort) is a genuine improvement, not a trade-off.
In practice, the reasons to convert PNG to JXL today are archival compression, lossless masters, and web delivery to the Chrome 155, Firefox 158 and Safari 17 audience, which is most desktop traffic once the October releases have rolled out. For web delivery, you would pair the JXL source with a WebP or PNG fallback in a <picture> element. For pipelines using Fastly Image Optimizer or a JXL-aware CDN, the CDN can negotiate the format automatically based on the client Accept header.
Convert PNG to JPEG XL with the PNG to JXL converter: a high-quality compressed encode by default, or switch Lossless on after uploading for a pixel-exact copy that is usually still smaller than the PNG.
Converting AVIF to JPEG XL
Converting AVIF to JPEG XL for current web delivery does not make much sense on compression grounds alone - both formats are competitive, and AVIF still has the broader installed base, including Edge and Samsung Internet, which have not yet shipped JXL. You would be trading ecosystem compatibility for marginal compression gains.
The case for AVIF-to-JXL conversion is narrower and more specific. For HDR and wide-gamut archival, AVIF supports HDR but tops out at 12-bit depth. JPEG XL goes to 32-bit. If you are building a long-term archive from AVIF masters, JPEG XL is the stronger archival target for high-bit-depth content. For consolidating a mixed archive, if you have a mix of JPEGs, PNGs, and AVIFs and want a single high-quality master format for storage, JPEG XL can ingest all of them. The masters become JXL; AVIF, WebP, and JPEG derivatives are generated from those masters for web delivery. And for pipeline readiness, building AVIF-to-JXL into your workflow means you can serve JXL to Chrome 155 and Firefox 158 now - you just put the JXL <source> first.
Convert AVIF to JPEG XL with the AVIF to JXL converter: a decode and high-quality re-encode, nothing to set.
The Fallback Pattern: Serving JXL Safely on the Web
The canonical pattern for JPEG XL on the web uses the HTML <picture> element. Browsers evaluate <source> elements in order and select the first format they support, falling back to the <img> tag for everything else.
<picture>
<source type="image/jxl" srcset="image.jxl">
<source type="image/avif" srcset="image.avif">
<source type="image/webp" srcset="image.webp">
<img src="image.jpg" alt="Description of image" width="800" height="600">
</picture>This stack gives you JXL for Chrome 155+, Firefox 158+ and Safari 17+, AVIF for Edge and older Chrome and Firefox, WebP for older clients, and JPEG for everything else.
Always include width and height attributes on the <img> tag. Browsers need these to reserve layout space before the image loads. Omitting them causes cumulative layout shift (CLS), which affects your Core Web Vitals score. See our guide on optimizing hero images for web performance for more on this.
Do not serve JPEG XL as your only format. A standalone <img src="image.jxl"> will display a broken image in Edge, in any Chrome or Firefox that has not yet updated to the October 2026 releases, and in email clients and chat apps. That remains the production reality for months after a release. If you need to send a JXL to someone whose software cannot open it, the JXL to JPG converter gives you a JPEG that opens anywhere.
CDN-level negotiation is cleaner than HTML for high-traffic sites. If you are on Fastly Image Optimizer, you can configure it to auto-negotiate JXL based on the Accept header, so the right format is served without changing your image markup. Cloudflare and Netlify do not yet offer this for JXL.
When Not to Use JPEG XL
JPEG XL is production-ready with a fallback in most contexts since October 2026, and still the wrong choice in a few. Being clear about the difference saves headaches.
Production-ready with fallbacks: any site whose audience is mostly on Chrome, Firefox or Safari (Chrome 155, Firefox 158 and Safari 17 decode JXL natively); internal archival and storage pipelines where browser support is irrelevant; sites running on Fastly Image Optimizer, which can serve JXL to capable clients automatically; HDR photography and retina-quality sites where the 32-bit depth is a real advantage.
Wait or test carefully: WordPress and Shopify sites - neither platform exposes JXL in its standard delivery stack. Mass-market web apps where a broken image in Edge or in a not-yet-updated Chrome is a business problem. Any pipeline that feeds third-party systems such as social previews, email clients, or ad networks, which mostly do not understand JXL and will display nothing.
Mochify Workflow: Convert to JPEG XL in One Prompt
Mochify handles JPEG XL conversion across all surfaces - the web app, the CLI, both MCP servers, and the REST API. For batches up to 25 files (Seller or Pro) or 3 files (Free), describe what you need in plain English and Magic Flow applies the right settings automatically.
- 1 Describe the task in plain English. Tell Mochify what you want and Magic Flow works out the settings. Example prompts: "Convert these JPEGs to JPEG XL, keep quality high", "Convert to JXL lossless for archival", or "Batch convert these PNGs to JPEG XL and reduce file size."
- 2 Mochify converts the files. Magic Flow (powered by Mistral Small 4) parses the prompt, resolves the appropriate format settings, and the C++ engine executes the conversion. Batches of up to 25 files on paid plans, 3 on Free.
- 3 Download and integrate. The converted JXL files come back ready to slot into your picture stack or archival storage. No manual settings panel, no quality slider - just a description of the outcome you need.
Privacy note: Images are streamed into server RAM at api.mochify.app for encoding and the originals are wiped immediately - no disk writes, no logs containing file data. The compressed JXL output comes back to you without the source being stored. For the hosted MCP server, the compressed output is held briefly in a pickup store (five-minute TTL) so the short-lived download URL can resolve; the local CLI and local MCP server skip the pickup store entirely and are zero-retention end-to-end.
JPEG XL Quick-Reference Cheat Sheet
| Scenario | Recommended mode | Expected size vs original | Notes |
|---|---|---|---|
| Archiving existing JPEGs | Lossless transcode (JPEG-in-JXL) | 20–30% smaller | Exact JPEG reconstruction preserved |
| Web photos, new encode | Lossy JXL from lossless master | 35–55% smaller than JPEG | Pair with AVIF/WebP/JPEG fallbacks |
| PNG graphics / UI / logos | Lossless JXL | 19–50% smaller than PNG | Transparency supported |
| Photographic PNGs | Lossy JXL | 60–80% smaller than PNG | Only if quality loss is acceptable |
| AVIF archives (HDR) | Lossless JXL | Comparable size | Use for long-term masters; serve AVIF for web |
| Choosing libjxl effort | Effort 7, the default | Effort 9 within 1%, 5x slower | Efforts 1–3 cost 14–30% overall (our 44-image test) |
| Screenshots and graphics, encoded once | Lossy JXL from a slower encoder (jixel Medium or Slow) | 13–63% smaller than libjxl effort 7 at equal quality | Test in the decoders your audience uses |
| WordPress / Shopify delivery | Avoid JXL as primary | n/a | Platform stacks optimized for WebP/AVIF |
| Safari-primary audience | JXL as first source | Best quality per byte | Always include AVIF/WebP/JPEG fallback |
| Chrome/Firefox general delivery | JXL as first source in picture | Best quality per byte | Default-on in Chrome 155+ and Firefox 158+; keep an AVIF/WebP/JPEG fallback |
Browser support summary (late 2026)
| Browser | JPEG XL support |
|---|---|
| Chrome 155+ (desktop and Android) | Yes, by default from October 6, 2026 (145 to 154: flag only) |
| Firefox 158+ | Yes, by default from October 13, 2026 |
| Safari 17+ | Still images only; no animation, no progressive decode |
| Edge, Samsung Internet, not-yet-updated installs | Not yet; keep an AVIF or WebP fallback |
| Global coverage | ~17% on October 7, 2026, rising as Chrome 155 and Firefox 158 roll out |
FAQ
Is JPEG XL better than AVIF?
Does Chrome support JPEG XL?
Can I convert a JPEG to JPEG XL without losing any quality?
What file types can I convert to JPEG XL?
Should I use JPEG XL for my Shopify store?
Does JPEG XL support transparency?
How do I serve JPEG XL with a fallback for unsupported browsers?
Is JPEG XL good for archiving photos?
Which JPEG XL encoder and settings should I use?
Ready to convert your images to JPEG XL? Drop your files at mochify.app and describe what you need in plain English - something like "convert these to JPEG XL for archival, keep full quality" or "batch convert to JXL and compress for web." No settings panel, no plugins, no signup required for up to 3 files.