JPEG is decades old, and every major image codec released since has beaten it on compression efficiency, quality, or both. Three of the current contenders — AVIF, HEIC, and JPEG XL — get mentioned constantly, often interchangeably, as if they're competing for the same job. They're not quite. Each made different trade-offs, and those trade-offs are why none of them has simply replaced JPEG outright yet.
AVIF
Built on the AV1 video codec, AVIF is open and royalty-free, and it has by far the widest real browser support of the three — Chrome, Firefox, and Safari all ship decoders today. It compresses meaningfully better than JPEG at equivalent visual quality, supports transparency (unlike JPEG), and can carry HDR data natively via PQ or HLG transfer functions baked into the pixel format itself — a fundamentally different approach from the gain-map technique this site's tools use.
HEIC
Apple's default photo capture format since iOS 11, built on HEVC (H.265) compression. It compresses well and supports features like image sequences and depth data, but two things hold it back outside Apple's ecosystem: HEVC is patent-encumbered, meaning royalties are owed to decode or encode it in software, and as a direct result, browser and cross-platform support is genuinely inconsistent. Plenty of websites and apps still reject HEIC uploads outright rather than deal with the licensing and decoding overhead.
JPEG XL
Technically the most impressive of the three on paper — it can losslessly recompress an existing JPEG to a meaningfully smaller file with zero further quality loss (a genuinely unusual capability), supports very high bit depths, and handles both photographic and graphic content well. Its problem isn't the format; it's support. Browser backing has been the weakest of the three — Chrome shipped, then removed, experimental support — which means real-world availability lags well behind AVIF's despite JPEG XL's technical advantages.
The practical takeaway
AVIF is the safest bet today for anything that needs to display broadly on the web. HEIC is fine as a capture format if everything downstream is Apple hardware, but a liability the moment it needs to leave that ecosystem. JPEG XL is genuinely promising and worth revisiting as support improves, but isn't yet something to depend on for content that has to just work everywhere. See also JPEG vs. PNG vs. WebP for how these newer formats compare against the previous generation, not just each other.