JPEG XL Compression Guide: Lossless & Lossy JXL Format Explained
Juraj Cukan
Founder, CEO & Lead Developer
Juraj is a Computer Science student at Comenius University in Bratislava, Slovakia, and the sole creator of FileSlim. Frustrated with inefficient and expensive compression tools, he built FileSlim from the ground up as a free, privacy-first alternative. Working entirely alone, Juraj developed every aspect of the platform—from the compression algorithms to the user interface—ensuring complete browser-based processing that never uploads files to servers. His work has helped users worldwide compress over 50 million files while maintaining complete privacy and achieving 60-90% file size reductions.
Quick Answer
JPEG XL (JXL) is the next-generation image format designed to replace JPEG. It offers 20-60% better compression than JPEG while supporting both lossy and lossless modes, transparency, HDR, progressive decoding, and animation. Currently supported natively in Safari 17+ with experimental support in Chrome and Edge behind flags.
— What is JPEG XL?
20-60% smaller than JPEGJPEG XL achieves 20-60% smaller file sizes than standard JPEG at equivalent visual quality, with both lossy and lossless compression modes.
~20% lossless JPEG recompressionJPEG XL can losslessly recompress existing JPEG files for approximately 20% savings with zero quality loss and perfect reconstruction.
JPEG XL vs JPEG vs PNG vs WebP vs AVIF
| Feature | JPEG XL | JPEG | PNG | WebP | AVIF |
|---|---|---|---|---|---|
| Compression Type | Both Lossy & Lossless | Lossy Only | Lossless Only | Both | Both |
| File Size vs JPEG | 20-60% smaller | Baseline | 5-10× larger | 25-35% smaller | 30-50% smaller |
| Lossless Support | Yes | No | Yes | Yes | Yes |
| Transparency | Yes | No | Yes | Yes | Yes |
| Animation | Yes | No | APNG | Yes | Yes |
| Progressive Decode | Yes | Yes | Yes (interlaced) | No | No |
| HDR Support | Yes | No | No | No | Yes |
| Browser Support | Safari 17+ | Universal | Universal | 97%+ | 93%+ |
Is JPEG XL Lossless?
Yes, JPEG XL supports both lossless and lossy compression. This is one of its key advantages over standard JPEG, which only supports lossy compression.
Lossless Mode
- • 35-50% smaller than PNG
- • Every pixel preserved perfectly
- • Ideal for archival, medical imaging, graphics
- • Can losslessly recompress existing JPEGs (~20% savings)
Lossy Mode
- • 20-60% smaller than JPEG at same quality
- • Excellent perceptual quality preservation
- • Ideal for photographs, web images
- • Progressive decoding for faster perceived load
Unique Feature: Lossless JPEG Recompression
JPEG XL can take any existing JPEG file and recompress it losslessly — the original JPEG can be perfectly reconstructed from the JXL file. This typically saves ~20% with zero quality loss, making it ideal for migrating existing JPEG libraries.
Which Browsers Support JPEG XL?
| Browser | Version | Status |
|---|---|---|
| Safari | 17+ | ✅Supported |
| Chrome | Flag only | ⚠️Behind flag |
| Firefox | Not yet | ❌Under consideration |
| Edge | Flag only | ⚠️Behind flag (Chromium) |
| Opera | Flag only | ⚠️Behind flag (Chromium) |
Web Implementation Tip: Use the HTML <picture> element to serve JPEG XL with fallbacks:
<picture> <source srcset="image.jxl" type="image/jxl" /> <source srcset="image.avif" type="image/avif" /> <source srcset="image.webp" type="image/webp" /> <img src="image.jpg" alt="Photo" /> </picture>
How to Compress with JPEG XL Using FileSlim
FileSlim supports JPEG XL compression through its Best Algorithm mode, which automatically tests JXL alongside other formats:
- Upload your image — Drag and drop or click to select any JPEG, PNG, or WebP file.
- Enable Best Algorithm mode — In the settings panel, toggle "Best Algorithm" on. This tests JPEG, WebP, AVIF, PNG, and JPEG XL compression.
- Adjust quality — Set your desired quality level (70-85% recommended for web, 90%+ for archival).
- Compress — FileSlim will test all supported formats and automatically select the smallest result.
- Download — The compressed file in the optimal format is ready for download.
💡 Tip
All processing happens locally in your browser using WebAssembly. Your files never leave your device, ensuring complete privacy.
Real-World File Size: JPEG vs JPEG XL
| Image Type | JPEG/PNG Size | JPEG XL Size | Savings |
|---|---|---|---|
| Photo (12MP DSLR) | 2.4 MB | 1.2 MB | 50% |
| Web Hero Image | 450 KB | 220 KB | 51% |
| Product Photo | 180 KB | 95 KB | 47% |
| Screenshot (lossless) | 1.8 MB | 720 KB | 60% |
| Icon/Logo (lossless) | 45 KB | 22 KB | 51% |
* File sizes are representative examples at equivalent visual quality (SSIM ≥ 0.95). Actual results vary by image content.
When to Use JPEG XL vs WebP vs AVIF
Use JPEG XL When:
- Targeting Safari users (iOS/macOS)
- Archiving photo libraries (lossless recompression)
- Need HDR image support
- Future-proofing your image pipeline
- Progressive loading is important
Use WebP When:
- Maximum browser compatibility needed (97%+)
- General web images
- Simple animations replacing GIF
- Safe, well-tested format needed
Use AVIF When:
- Maximum compression is priority
- Good browser support needed (93%+)
- HDR content support
- Encoding speed is less critical
JPEG XL FAQ
Is JPEG XL lossless?
Yes, JPEG XL supports both lossless and lossy compression. In lossless mode, it achieves 35-50% smaller files than PNG while preserving every pixel perfectly. In lossy mode, it's 20-60% smaller than standard JPEG at equivalent visual quality. This dual capability makes JPEG XL uniquely versatile - it can replace both JPEG and PNG.
Which browsers support JPEG XL?
As of 2026, Safari 17+ (macOS and iOS) has full native JPEG XL support. Chrome, Edge, and Opera have experimental support behind flags (chrome://flags → #enable-jxl). Firefox has JPEG XL under consideration but hasn't shipped support yet. For web use, provide JPEG/WebP fallbacks alongside JXL using the <picture> element.
Is JPEG XL better than WebP?
JPEG XL is technically superior to WebP in most metrics: 10-20% better compression ratios, lossless compression support, HDR support, progressive decoding, and animation. However, WebP has 97%+ browser support while JPEG XL is limited to Safari 17+. For maximum compatibility today, use WebP. For future-proofing and archival, JPEG XL is the better choice.
How much smaller is JPEG XL than JPEG?
JPEG XL typically achieves 20-60% smaller file sizes than standard JPEG at the same visual quality. The exact savings depend on image content: photos with fine detail see 30-50% reduction, while images with large uniform areas can see up to 60% reduction. JPEG XL also supports lossless recompression of existing JPEG files for 20% savings with zero quality loss.
Can I use JPEG XL on my website?
You can use JPEG XL on your website today with proper fallbacks. Use the HTML <picture> element to serve JXL to supported browsers (Safari 17+) with JPEG or WebP fallbacks for others. FileSlim's Best Algorithm mode automatically tests JPEG XL compression when your browser supports it, helping you generate optimized JXL files.
How do I convert images to JPEG XL?
Use FileSlim to convert images to JPEG XL directly in your browser: 1) Upload your image, 2) Enable 'Best Algorithm' mode in settings, 3) FileSlim will automatically test JPEG XL alongside other formats and pick the smallest result. Alternatively, select JPEG XL as the output format manually. No software installation needed.
Does FileSlim support JPEG XL compression?
Yes! FileSlim supports JPEG XL (JXL) compression using WebAssembly-based encoding. When you enable 'Best Algorithm' mode, FileSlim automatically tests JPEG XL alongside JPEG, WebP, AVIF, and PNG, then selects whichever format produces the smallest file. JXL encoding requires a browser with JPEG XL support (Safari 17+) or works through the WebAssembly encoder.
Will JPEG XL replace JPEG?
JPEG XL was designed as a successor to JPEG, but full replacement will take years. JPEG has been the standard for 30+ years with universal support. JPEG XL offers a unique migration path: it can losslessly transcode existing JPEG files (saving ~20%) while maintaining backward compatibility. As browser support expands, JPEG XL will likely become the preferred format for new content, while JPEG remains a reliable fallback.
Related Tutorials
Understand the differences between JPEG and PNG formats and when to use each.
Complete guide to image compression. Learn JPEG, PNG, and WebP optimization.
Master lossless compression techniques to reduce file size without visible quality degradation.
