The 2026 Web Image Format Cheat Sheet: AVIF Takes Over, JPEG XL Waits
From GIF to AVIF: Evolution of Web Image Formats and a 2026 Selection Guide
When you drop an image into a web page, saving it as PNG might cost a few hundred KB, and screenshot tools often produce even larger outputs. Images usually account for the bulk of page traffic; picking the wrong format means making users pay several times more bandwidth for the same visual result. And the question "what format should I use?" gets reanswered every few years—at the point of November 2026, the answer is already different from three years ago.
This note uses MDN's Image file type and format guide as its basis, summarizes the pros and cons of six common formats—GIF, JPEG, PNG, SVG, WebP, AVIF—then uses the latest caniuse data to fill in the current browser support landscape, and finally gives selection advice you can copy directly.
1. Timeline of origins
Lining up common web image formats by first specification or first public release:
| Format | Birth date | Corresponding event |
|---|---|---|
| GIF | 1987-06-15 | CompuServe's first GIF87a specification. Original spec |
| JPEG / JPG | 1992-09-18 | ITU approves JPEG compression standard T.81. ITU record |
| PNG | 1996-10-01 | PNG 1.0 becomes a W3C Recommendation; the format began forming in December 1994. PNG 1.0 spec |
| SVG | 2001-09-04 | SVG 1.0 becomes a W3C Recommendation, positioned as a vector graphics format. SVG 1.0 spec |
| WebP | 2010-09-30 | Google publicly releases the WebP developer preview. Chromium announcement |
| AVIF | 2019-02-19 | The Alliance for Open Media's AVIF 1.0 specification date. AVIF 1.0 spec |
From GIF to AVIF spans 32 years; WebP came about eight and a half years before AVIF. Two patterns emerge from the timeline.
Pattern one: every new format sits on the pain points of the old era. GIF was born in 1987 when dial-up reigned; it only solved "getting the image across." JPEG used lossy compression to tame photo size. PNG was an open-source replacement forced by the LZW patent dispute (Unisys claimed fees in 1994), and incidentally added transparency. SVG turned "graphic description" from pixel grids to vectors. WebP and AVIF both come from video coding technology. WebP derives from Google's acquired VP8; AVIF comes from the Alliance for Open Media's AV1. The encoder's accumulated experience in intra-frame compression directly translates into static image compression advantages.
Pattern two: being born does not mean being usable; there is often a five-to-ten-year gap. WebP launched in 2010; Safari didn't support it until Safari 14 in 2020, a full ten years. AVIF was finalized in 2019; it took until Edge 121 in early 2024 to cover all evergreen browsers, about five years. So when evaluating a new format, looking only at the specification release date is meaningless; you need to track browser adoption. This is the standard used repeatedly below.
2. Walk through each format
GIF (1987): Universal compatibility, but time to retire
GIF uses LZW for lossless compression, but only supports 8-bit indexed color (max 256 colors), only 1-bit transparency (hard edges, no semi-transparency), and its animation lacks modern inter-frame compression. Its strength is that every browser that can display images knows it, plus meme culture keeps it alive and plentiful on the web.
But MDN's advice is direct: prefer PNG for static images, consider WebP, AVIF, or APNG for animation. A 10-second GIF animation converted to MP4/WebM video is usually an order of magnitude smaller. Today, still putting GIF on pages is usually out of habit, not because GIF is appropriate.
JPEG (1992): The baseline for photos
JPEG is actually JFIF container format with JPEG compression data, based on discrete cosine transform (DCT) for lossy compression: no transparency, no indexed color, only 8-bit true color, with a maximum dimension of 65,535×65,535 pixels.
- Pros: Very broad compatibility; every browser, image tool, and third-party platform has recognized it since 1992. The compression efficiency for photo-like content is still sufficient. Supports progressive encoding, so large images load "blurry first, then sharp," good for weak networks.
- Cons: No transparency channel; every lossy edit degrades the image; ringing artifacts appear at high-contrast edges; 8-bit color depth means no HDR.
In 2026, it is no longer the first choice for photos, but it remains the eternal fallback format. In any scenario where you don't know what the other side supports, JPEG is the greatest common divisor.
PNG (1996): The basic for lossless and transparency
PNG does lossless compression, supporting 1/2/4/8/16-bit grayscale, true color, and indexed color, with full alpha transparency and a maximum size of about 2.1 billion pixels.
- Pros: Pixel-exact; screenshots and UI captures lose no detail. Transparent channel is solid; 16-bit depth leaves room for professional scenarios.
- Cons: For photo-like content, lossless compression is far less efficient than lossy formats; file sizes are often several times JPEG.
Its positioning is clear: use it for screenshots and scenarios needing exact pixels; don't use it for photos.
SVG (2001): The only answer for vector graphics
SVG is an XML-based text format that stores graphics as geometry rather than pixels, allowing infinite scaling. It can be used as a standalone file via <img> or background-image, or inlined directly into HTML, and supports CSS and script control of style, animation, and interaction. After HTTP compression (gzip), transfer size is very small.
- Pros: Icons, charts, and diagrams are produced once and work at any resolution. They can follow the site's light/dark theme (this site's covers do this). Inline text remains selectable, which is good for accessibility and SEO.
- Cons: Only suitable for "drawn" graphics; photos are out. Complex SVGs with many nodes may cost more to parse and render than bitmaps. When loaded as standalone files, avoid embedding scripts for security.
Icons, charts, diagrams—that's the default answer.
WebP (2010): The all-rounder after a ten-year marathon
WebP's lossy mode is based on VP8, on average 25%–35% smaller than JPEG; lossless mode is about 26% smaller than PNG; supports animation (ANIM/ANMF blocks) and alpha transparency.
- Pros: One format covers four needs simultaneously: lossy photos, lossless screenshots, transparency, and animation. After Safari 14 in 2020, all modern browsers support it; compatibility has no gaps.
- Cons: Lossy mode stores 8-bit YUV420, so chroma subsampling blurs high-contrast text edges. Maximum dimension is 16,383×16,383 pixels; no progressive rendering.
It's the "safe default" today. When unsure what to use, WebP won't go wrong.
AVIF (2019): The new top student, safe to use starting 2026
AVIF comes from AV1's intra-frame coding, set by the Alliance for Open Media, royalty-free. Its compression rate is the strongest in its class: lossy mode is about 50% smaller than JPEG and beats WebP (MDN gives median data: AVIF ~50% compression, WebP ~30%). It also supports 10/12-bit color depth, HDR, wide gamut, YUV444, lossless compression, alpha transparency, animation, and grayscale.
- Cons: Encoding is slow; CPU cost at build and CDN side is noticeably higher than WebP. No progressive rendering; large images must be fully downloaded before they show. Animation support varies by browser (Firefox early on only supported static images).
- Compatibility: Chrome 85 (2020), Firefox 93, Safari 16.4 (partial from 16.1), Edge 121 (early 2024). At this point, all evergreen browsers support AVIF. The MDN Chinese page still carries a stale "Edge not supported" note—outdated.
First choice for photos and rich media images, with WebP/JPEG fallback.
Side note: APNG
Mozilla-led "animated PNG": lossless, true color, supported by all major browsers; looks and size are better than GIF, commonly used for stickers. But for compression size, animated WebP and animated AVIF are more efficient. APNG can be the direct upgrade path for GIF animations, but there's no reason to actively choose it in new projects.
3. Summary comparison
| Format | Compression | Transparency | Animation | Color depth highlights | Browser support (2026-11) | One-line positioning |
|---|---|---|---|---|---|---|
| GIF | Lossless (256-color indexed) | 1-bit | Yes | 8-bit indexed | All | Old animation format, replace soon |
| JPEG | Lossy | No | No | 8-bit | All | Fallback and maximum compatibility |
| PNG | Lossless | Alpha | No | 16-bit | All | Screenshots and exact pixels |
| SVG | Vector description | Yes | Yes | Resolution-independent | All | Icons and charts |
| WebP | Lossy + lossless | Alpha | Yes | Lossy 8-bit | All (completed 2020) | Safe default |
| AVIF | Lossy + lossless | Alpha | Yes | 12-bit, HDR | All evergreen (completed 2024) | Photo first choice |
4. Formats to stop using
MDN explicitly lists an "avoid" set, with crisp reasons:
- BMP: Basically no compression, huge files, no reason to appear on a web page;
- ICO: For favicons, use PNG with
<link rel="icon" type="image/png">; ICO is only for extremely old Windows compatibility; - TIFF: A scanning and print format; browsers barely support it (Safari treats it as a download); don't touch it on the web;
- XBM: Long deprecated and has security risks.
5. How to choose at the 2026 node
Decision table by content type
| Content type | First choice | Fallback |
|---|---|---|
| Photos | AVIF | WebP → JPEG |
| Icons / UI elements | SVG | PNG or lossless WebP |
| Screenshots | Lossless WebP | PNG |
| Charts / diagrams | SVG | PNG |
| Animation | Video (MP4/WebM) or animated AVIF/WebP | APNG |
In MDN's table, the first choice for photos is written as "WebP or JPEG"—that's a conservative "maximum compatibility first" stance. If your traffic stats show legacy browsers are negligible (true for most sites in 2026), the first choice for photos should be upgraded to AVIF.
Fallback pattern
The <img> tag itself doesn't support format fallback; you need <picture> with multiple <source> elements:
<picture>
<source srcset="photo.avif" type="image/avif" />
<source srcset="photo.webp" type="image/webp" />
<img src="photo.jpg" width="1200" height="800" alt="Mountain sunrise" />
</picture>
The browser picks the first format it recognizes from the <source> order; <img> is the final fallback and carries width/height/alt. Don't skip these three attributes; they prevent layout shift and ensure accessibility. Two or three <source> elements are enough; more just wastes the build output.
2026's wildcard: JPEG XL
Outside the timeline, JPEG XL deserves special mention. The spec is set by the JPEG committee (ISO/IEC 18181, finalized 2022). Both lossy and lossless compression target AVIF and PNG's positions, and it uniformly supports progressive rendering and animation. It was once touted as the "ultimate image format." But its browser adoption has been extremely tortuous:
- Chrome removed experimental support in version 110 in early 2023, triggering strong community backlash;
- 2026 reversed course: Chrome 155 and up, Firefox 158 and up, Opera 139 and up enable it by default (each previously had its own flag phase);
- Edge to this day (up to version 156) has no support across the board; Safari has partial support since 17 (static images only).
The current caniuse JPEG XL data gives about 54% global default support, 69% with partial support. Conclusion: JPEG XL is the variable most worth watching right now, but it's still far from "bare use." MDN's recommendation list hasn't included it yet. New projects don't need to adapt their pipeline for it; existing sites can keep an eye on it at the CDN layer, waiting for Edge and Safari to fill in before considering full migration.
Engineering-side convenient practices
- Auto-generate multiple formats at build time: A pipeline with one source file and multiple outputs is mature; Astro's built-in image service (based on sharp) can automatically convert formats during build.
- CDN content negotiation: Return AVIF/WebP automatically based on the request's
Acceptheader (e.g., Cloudflare Polish or image CDNs). This is the lowest-cost solution for existing sites. - Don't judge by size alone: AVIF has no progressive rendering; large images on weak networks appear as "white block then sudden reveal," which can be worse than progressive JPEG. Worth doing comparison tests for above-the-fold images.
My blog's approach
This blog itself is a reference sample: article covers uniformly use SVG vector images that adapt to the light/dark theme, and at build time generate WebP companion images for social sharing cards. Body screenshots are uniformly WebP. When distributing to platforms like WeChat that don't support WebP, they are converted to PNG/JPG in real time. The payoff of format selection isn't "how much a single image saves," but the accumulated traffic and storage savings of a site with several hundred images over a year.
Conclusion
When you get an image, ask three questions:
- Is it vector? (icons, charts, diagrams) → SVG;
- Is it a photo? → AVIF, with WebP/JPEG fallback;
- Other bitmaps (screenshots, exact pixels) → lossless WebP, with PNG as a safety net.
Finally, a lesson from the timeline: between a format's "birth" and "usable" often lies five to ten years. Watching browser adoption progress is more practical than watching compression-rate papers.
References
- MDN: Image file type and format guide (the basis of this article; most format feature data comes from here)
- caniuse: AVIF, caniuse: JPEG XL (browser support data, queried November 2026)