MEDIA GUIDES / Image formats

AVIF vs JPEG: Image Quality, Compression, Speed & Browser Support

Key takeaways:

  • AVIF files are typically 30-50% smaller than JPEG at equivalent visual quality.
  • JPEG works in literally every browser, OS, and image viewer ever made.
  • AVIF supports HDR, wide color gamut, and transparency; JPEG handles plain photographs.
  • Cloudinary can serve AVIF or JPEG to each user based on what their browser supports, no manual fallback wrangling required.

A product page that loads instantly on mobile data. A photograph that ships at 60KB instead of 200KB without losing a pixel of detail.

Both depend on the image format you used to ship. JPEG has been the safe pick for over thirty years, but AVIF has shown up with smaller files, better quality, and the browser support to back it up.

In this AVIF vs JPEG breakdown, we’ll cover image quality, compression efficiency, performance, and browser support so we can pick the right format for our project. We’ll also see how Cloudinary delivers the right one to every visitor without us lifting a finger.

In this article:

What Is AVIF?

AVIF (AV1 Image File Format) showed up around 2019 as the still-image sibling of the AV1 video codec. It uses the same advanced compression techniques, just applied to single frames instead of video, which is why it punches so far above JPEG’s weight class.

AVIF supports a long list of features that JPEG can’t touch. That includes HDR images, wide color gamuts up to 12-bit depth, true transparency through alpha channels, and even short animations.

For modern displays that show wider colors and brighter highlights, AVIF actually preserves what we shot. For graphics with transparent edges, it lets us skip the awkward JPEG-to-PNG dance entirely.

What Is JPEG?

JPEG has been the default web image format since 1992. It’s older than the modern web itself, predates HTTPS, and somehow still ships in roughly half the images we see online. The format uses Discrete Cosine Transform compression to throw away visual information our eyes barely notice. It keeps file sizes manageable for photographs.

On top of that, JPEG handles 8-bit color, but doesn’t support transparency and can’t do HDR. There are other versions of JPEG that do support beyond 8-Bit color, but they aren’t usually found in commercial software.

But every browser, image viewer, phone, camera, smart fridge, toaster, and CMS on the planet handles a typical JPEG without complaint. That’s why it remains the universal fallback.

File Size and Compression

For ‌file size, AVIF typically produces files 30-50% smaller than JPEG at the same perceived quality, and the gap actually widens at lower bitrates, where JPEG shows its age.

On the other side, JPEG uses DCT compression and quantization, which is fast but coarse. The format struggles with smooth gradients, flat color regions, and high-detail textures, all of which produce visible artifacts at lower quality settings. AVIF’s underlying AV1 algorithms handle those cases gracefully, holding onto detail and color accuracy where JPEG blotches.

For a hero image on a landing page, that difference can mean shipping a 60KB AVIF instead of a 180KB JPEG. Multiply that across every image on the site, and the bandwidth savings stack up fast.

Image Quality in Practice

When we talk about image quality, what really matters is how an image looks at the file size we can actually afford to ship. AVIF wins this consistently, especially below one megabit per pixel.

JPEG’s classic failure modes are visible to anyone who’s looked closely at a low-quality image: blocky 8×8 pixel artifacts in flat areas, color bleeding around sharp edges, and ringing patterns near text or contrast lines. These get worse as we crank quality settings down to save bandwidth.

AVIF avoids most of those problems. Smooth gradients stay smooth, high-detail areas keep their texture, and edges stay crisp. At higher quality settings, the gap narrows, but for the bandwidth-conscious settings real production apps use, AVIF noticeably outperforms.

Performance and Encoding Speed

This is where JPEG strikes back. On the same hardware, JPEG encodes 10 to 20 times faster than AVIF. For workflows that process millions of images at upload time, that gap adds up to real CPU costs and noticeable pipeline delays.

AVIF, by contrast, is slow to encode. Even with fast presets, a single image can take seconds to compress, compared to milliseconds for JPEG. Hardware acceleration helps, and modern encoders like rav1e and SVT-AV1 have improved a lot, but JPEG still wins on raw throughput.

Decoding tells a different story. Modern browsers decode AVIF nearly as fast as JPEG, so end-user playback isn’t the bottleneck. The cost lives entirely on the server side, which is why offloading transcoding to a media platform makes sense (more on that shortly).

Browser and Platform Support

JPEG works everywhere. Any device that has rendered an image in the last 30 years can decode it without complaint, which is a bar no other format has matched. That’s why JPEG still ships as the universal fallback, even though newer formats compress better.

AVIF, by contrast, has caught up fast. Chrome added support in version 85 in August 2020, and Edge closed the gap in version 121 in January 2024, which means every major browser now decodes it. As a result, around 95% of global web traffic can render AVIF today, per Can I Use. The remaining 5% is mostly users on iOS 15 or earlier, since Apple didn’t ship AVIF until iOS 16 in September 2022.

So the practical strategy is simple: serve AVIF to browsers that support it, and fall back to JPEG for everything else. The HTML <picture> element handles the negotiation natively, so you don’t need user-agent sniffing on the server:

<picture>
  <source srcset="/images/hero.avif" type="image/avif">
  <img src="/images/hero.jpg" alt="Mountain landscape at sunset">
</picture>

The browser reads the <source> list, picks AVIF if it can decode it, and falls back to the JPEG if it can’t. The catch is you need both files available, which gets tedious without automation.

Pro Tip!

Simplify image transformations through URLs

Resize, crop, and enhance images instantly with simple URL tweaks. Skip the editing tools and move faster.


-> Discover a smarter way to transform images.

When to Use Each Format

The AVIF vs JPEG decision mostly comes down to how much we care about bandwidth and modern features versus how wide our compatibility net needs to be.

Pick AVIF when:

  • Bandwidth and page load speed are top priorities.
  • You’re delivering high-quality photography or hero imagery.
  • You need HDR, wide color, or transparency.
  • Your audience is on modern browsers (which is most audiences these days).

Pick JPEG when:

  • You need to support legacy browsers or older devices.
  • Encoding speed matters more than file size (real-time pipelines, user-uploaded content).
  • The image is going somewhere outside the web (email, document export, printing).
  • The asset will be processed downstream by tools that expect JPEG.

Ship both when:

  • You want every visitor to get the best version their browser supports.

Automating Format Delivery With Cloudinary

Maintaining parallel AVIF and JPEG pipelines by hand is tedious work that no engineer dreams of. Cloudinary is a media platform with an Image API that handles format conversion and delivery as part of the URL itself.

To force a specific format, we add f_ (format) to the delivery URL:

// AVIF delivery
https://res.cloudinary.com/demo/image/upload/f_avif/sample.jpg

// JPEG delivery
https://res.cloudinary.com/demo/image/upload/f_jpg/sample.jpg

The original asset never changes. Cloudinary transcodes the image on demand, caches the result on the CDN, and serves it from then on. Here’s the same idea using the Node.js SDK:

const cloudinary = require('cloudinary').v2;

// AVIF for capable browsers
const avifUrl = cloudinary.url('product-hero', {
  format: 'avif',
  quality: 'auto'
});

// JPEG fallback for older clients
const jpegUrl = cloudinary.url('product-hero', {
  format: 'jpg',
  quality: 'auto'
});

console.log({ avifUrl, jpegUrl });

The script generates both URLs from a single source asset. We can wire them into a <picture> element ourselves, but the smarter approach is letting Cloudinary handle the negotiation entirely.

That’s where f_auto comes in. With one parameter, Cloudinary inspects the requesting browser and serves the most efficient format it can decode:

https://res.cloudinary.com/demo/image/upload/f_auto,q_auto/sample.jpg

The same URL serves AVIF to modern Chrome, AVIF to Safari 16.4+, WebP to slightly older Safari, and JPEG to anything truly ancient. Format negotiation, quality optimization, and CDN delivery in a single line.

AVIF vs JPEG: Which Is the Winner?

The AVIF vs JPEG choice isn’t really a choice for most modern web projects. AVIF for browsers that support it, JPEG for the rest, and ideally WebP in the middle. The real question is who’s generating the variants, hosting them, and routing each request to the right file.

Doing this by hand means three versions of every image, a build step that handles AVIF’s slow encoding without melting your CPU, and a <picture> element wired into every template.

Doing it with Cloudinary means one source asset, one URL with f_auto, and a CDN that picks the right format per request automatically. The format strategy is the same either way. The difference is how much of your week you spend maintaining it.

Boost your website’s speed and user experience by optimizing your images with Cloudinary–whether it’s AVIF, JPEG, or anything else. Sign up for free today!

Frequently Asked Questions

Is AVIF really better than JPEG?

For most modern web use cases, yes. AVIF produces 30 to 50% smaller files at equivalent visual quality, supports HDR and wide color, and handles transparency natively. JPEG still wins on universal compatibility and encoding speed, but for delivering web images to current browsers, AVIF is the more efficient choice.

Does Safari support AVIF?

Yes, Safari has supported AVIF since version 16.4, released in April 2023. That covers iOS 16.4+, iPadOS 16.4+, and macOS Ventura 13.3+. Older Safari versions don’t decode AVIF, so a JPEG or WebP fallback is still important for users on devices that haven’t been updated.

Why is AVIF encoding so slow?

AVIF uses the AV1 video codec’s compression algorithms, which are computationally expensive by design. A single image can take seconds to encode, compared to milliseconds for JPEG. Faster encoders like SVT-AV1 and hardware acceleration help, but the gap is real and won’t fully close.

QUICK TIPS
Nadin Indre
Cloudinary Logo Nadin Indre

In my experience, here are tips that can help you better choose and operationalize AVIF vs JPEG for modern image delivery:

  1. Test on perceptual quality, not quality numbers
    A JPEG at q_80 and an AVIF at q_50 are not equivalent. Compare outputs using visual review, SSIMULACRA2, Butteraugli, or side-by-side crops instead of assuming matching quality settings mean matching quality.
  2. Use AVIF more aggressively for large visual assets
    Hero images, product galleries, editorial photography, and lifestyle banners usually deliver the biggest savings. Small thumbnails may not justify the added encoding cost because metadata and container overhead can reduce the benefit.
  3. Keep JPEG masters out of the conversion chain
    Don’t generate AVIF from already-compressed JPEGs unless that is your only source. Start from the highest-quality original available, such as TIFF, PNG, RAW-derived exports, or minimally compressed masters, to avoid baking JPEG artifacts into the AVIF.
  4. Watch for AVIF color shifts in production
    AVIF can preserve wide color, but bad color-profile handling can make images look dull or oversaturated across browsers and devices. Validate product-critical colors on real iPhones, Android phones, and wide-gamut displays before rollout.
  5. Set stricter rules for product images than lifestyle images
    Product images need accurate color, texture, edges, and labels. Lifestyle images can often tolerate heavier compression. Use separate quality policies instead of one global AVIF/JPEG setting across the whole site.
  6. Don’t use AVIF blindly for text-heavy graphics
    AVIF can perform well, but UI screenshots, diagrams, and images with small text may need different tuning. Check thin lines, glyph edges, and contrast boundaries carefully because compression artifacts can hurt readability.
  7. Pre-generate AVIF for traffic-heavy assets
    On-demand conversion is convenient, but your homepage hero, campaign images, and best-selling product shots should be warmed or pre-generated before launch. This avoids first-request latency during high-traffic windows.
  8. Keep JPEG fallbacks visually aligned
    The fallback JPEG should not look noticeably worse than the AVIF. Users on older browsers should not see muddy colors, different crops, or heavier artifacts, especially on brand-sensitive pages.
  9. Segment analytics by delivered format
    Track LCP, bounce rate, conversion rate, and image error rate by actual served format. This reveals whether AVIF is improving real user experience or whether specific browsers, regions, or devices need adjusted delivery rules.
  10. Use format choice as part of a larger image budget
    AVIF helps, but it will not fix oversized dimensions, unnecessary images, poor lazy loading, or unoptimized responsive breakpoints. Set page-level image budgets first, then use AVIF and JPEG delivery to stay within them.
Last updated: Jun 3, 2026
★★★★★
4.8 (29 reviews)