AVIF vs WebP vs HEIC vs PNG: Which Format Should You Use?

Four formats, four different jobs. Compression gets the headlines, but what actually decides the answer is simpler: where the file has to open, and whether it needs transparency.

Last updated: 2026-11-01 · Reviewed by Yilin Xu · Test images: 3 files, converted with Chrome 156 and ImageMagick 7.1.2-35

The short answer

FormatUse it forAvoid it when
AVIFPhotographs published on the web; anything where file size matters and you control the viewerYou need it to open in older software, email clients or office apps
WebPWeb images that must work everywhere a modern browser runs; transparent UI assets that need to stay smallYou need 10-bit, HDR, or compatibility with very old Safari
HEICPhotos staying inside the Apple ecosystem; iPhone camera rollThe file leaves Apple devices, or goes on a website
PNGScreenshots, logos, icons, anything with transparency or hard edgesThe image is a photograph — PNG will be several times larger than JPG

If you only remember one line: AVIF for photos on the web, PNG for graphics with transparency, JPG when it has to open anywhere, HEIC stays on the iPhone.

What each format actually is

PNG (1996) is a lossless format built on DEFLATE compression. It stores every pixel exactly, supports an alpha channel and 16-bit colour. That is why it is perfect for screenshots and terrible for photographs: a 12-megapixel photo saved as PNG can easily be ten times the size of the same photo as JPG.

JPG (1992) is lossy: it discards detail the eye is less likely to notice, in exchange for small files. It has no transparency, no animation, 8-bit colour and no HDR. It is also the only format that opens literally everywhere, which is why it refuses to die.

WebP (2010, Google) comes in two modes — a lossy one based on the VP8 video codec and a separate lossless mode. It supports transparency and animation, and typically produces files 25–35% smaller than JPG at similar quality. Its limit is age: 8-bit only, no HDR, and a maximum canvas of 16,383 pixels per side.

HEIC is not a codec but a container (HEIF) holding HEVC-compressed images. Apple made it the iPhone default in 2017, which is why half the world's photos are in it. It supports 10-bit colour, HDR and image sequences. Its problem is licensing: HEVC is covered by patent pools, so browsers never adopted it.

AVIF is the same container idea, but with AV1 instead of HEVC. AV1 is royalty-free, which is the single reason Chrome, Firefox and Safari all support it. AVIF handles 10- and 12-bit colour, HDR, transparency and animation, and generally beats WebP on photographic content.

File size at the same visual quality

FormatRough size vs JPGNotes
PNG300–600%Lossless; the penalty grows with photo detail
JPG100% (baseline)Quality 85–92 is the practical sweet spot
WebP65–75%Bigger gains on photos, smaller on graphics
HEIC45–55%Comparable to AVIF, but only inside Apple's ecosystem
AVIF40–55%Best on detailed photographs; gains shrink on screenshots

These ranges are typical results, not guarantees. Compression ratios depend heavily on content: a flat illustration may compress better as PNG, a noisy night photo may favour AVIF by a wide margin. Measure your own images before committing to a pipeline.

Transparency, animation and HDR

FormatTransparencyAnimation10-bit / HDR
PNGYesNo (APNG is a separate extension)16-bit colour, no HDR
JPGNoNoNo
WebPYesYesNo — 8-bit only
HEICYesYes (image sequences)Yes
AVIFYesYesYes

The practical consequence: if you are converting an AVIF logo to JPG, you are throwing away the alpha channel and gaining nothing. Use PNG instead. JPG is for photographs.

What opens what

FormatBrowsersNative OS supportTypical app support
JPGEvery browser ever shippedEvery OSUniversal
PNGEvery browser ever shippedEvery OSUniversal
WebPAll current browsers; Safari 14+Windows 10/11, macOS 11+, Android, iOS 14+Wide, but some older editors need a plugin
AVIFChrome 85+, Firefox 93+, Safari 16+, current EdgeWindows with the AVIF/AV1 packages, macOS 13+, iOS 16+, Android 12+Growing; patchy in older editors and office software
HEICSafari only, and only in some contextsApple platforms since iOS 11 / macOS High SierraLimited outside Apple; Windows needs a HEIF package, sometimes a paid HEVC codec

Browser version numbers mark the first release with decoding enabled. Support on older operating systems can lag the browser, which is why a current Chrome on an old Windows install may still refuse an AVIF until the system codec is installed. See the Windows guide for that case.

Why HEIC never took over the web

HEIC is technically excellent — better than JPG, comparable to AVIF. It failed on the web for a legal reason, not a technical one. HEVC is covered by several patent pools, and a browser that ships an HEVC decoder exposes itself to licensing costs it cannot control. AV1 was designed by the Alliance for Open Media specifically to avoid that trap, and it is royalty-free.

The result is a clean split: HEIC owns the iPhone camera roll, AVIF owns the modern web, and JPG owns everything in between. That split is unlikely to change soon.

Which should you use?

What you lose when you convert

Rule of thumb: convert from the highest-quality source you still have, and keep that source until the project is finished.

Frequently asked questions

Is AVIF better than WebP?For photographs, usually yes — smaller files at the same visual quality. For flat graphics and screenshots the difference narrows, and WebP's wider compatibility can outweigh the size gain.
Why does my iPhone produce HEIC instead of AVIF?Apple adopted HEVC years before AV1 hardware decoding was common. You can change the setting under Settings → Camera → Formats, but the alternative is JPG, not AVIF.
Can I use AVIF on a website today?Yes, with a fallback. Serve AVIF inside a <picture> element with a JPG or WebP <img> fallback, so browsers that cannot decode AVIF still get a working image.
Does PNG support animation?Not in the original specification. APNG is a separate extension supported by most browsers but not by all image editors, which is why GIF and WebP are still used for simple animation.
Which format is best for screenshots?PNG. Screenshots contain large flat areas and sharp text, exactly the content that lossless compression handles well and JPEG handles badly.
Will converting to AVIF make my old JPG look better?No. AVIF can only preserve what is already there; it cannot restore detail the JPG discarded. It may make the file smaller, which is a different goal.

Related guides