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.
| Format | Use it for | Avoid it when |
|---|---|---|
| AVIF | Photographs published on the web; anything where file size matters and you control the viewer | You need it to open in older software, email clients or office apps |
| WebP | Web images that must work everywhere a modern browser runs; transparent UI assets that need to stay small | You need 10-bit, HDR, or compatibility with very old Safari |
| HEIC | Photos staying inside the Apple ecosystem; iPhone camera roll | The file leaves Apple devices, or goes on a website |
| PNG | Screenshots, logos, icons, anything with transparency or hard edges | The 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.
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.
| Format | Rough size vs JPG | Notes |
|---|---|---|
| PNG | 300–600% | Lossless; the penalty grows with photo detail |
| JPG | 100% (baseline) | Quality 85–92 is the practical sweet spot |
| WebP | 65–75% | Bigger gains on photos, smaller on graphics |
| HEIC | 45–55% | Comparable to AVIF, but only inside Apple's ecosystem |
| AVIF | 40–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.
| Format | Transparency | Animation | 10-bit / HDR |
|---|---|---|---|
| PNG | Yes | No (APNG is a separate extension) | 16-bit colour, no HDR |
| JPG | No | No | No |
| WebP | Yes | Yes | No — 8-bit only |
| HEIC | Yes | Yes (image sequences) | Yes |
| AVIF | Yes | Yes | Yes |
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.
| Format | Browsers | Native OS support | Typical app support |
|---|---|---|---|
| JPG | Every browser ever shipped | Every OS | Universal |
| PNG | Every browser ever shipped | Every OS | Universal |
| WebP | All current browsers; Safari 14+ | Windows 10/11, macOS 11+, Android, iOS 14+ | Wide, but some older editors need a plugin |
| AVIF | Chrome 85+, Firefox 93+, Safari 16+, current Edge | Windows with the AVIF/AV1 packages, macOS 13+, iOS 16+, Android 12+ | Growing; patchy in older editors and office software |
| HEIC | Safari only, and only in some contexts | Apple platforms since iOS 11 / macOS High Sierra | Limited 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.
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.
Rule of thumb: convert from the highest-quality source you still have, and keep that source until the project is finished.
<picture> element with a JPG or WebP <img> fallback, so browsers that cannot decode AVIF still get a working image.