ResizeTo

Guide

JPEG, PNG, WebP or HEIC

Four formats turn up in everyday life, and picking the wrong one can multiply a file by twenty. What each one is for, with the same five photographs weighed in each of the three formats a browser can write.

What each one is

JPEG (1992) is lossy, universal and has no transparency. It throws away detail your eye is bad at noticing and stores the rest cheaply. Every camera, every phone, every upload form and every piece of software on earth reads it. It is the lowest common denominator, and that is its entire value.

PNG (1996) is lossless: what goes in comes back out, pixel for pixel. It supports transparency and it compresses flat areas of identical colour extremely well. It was designed for logos, diagrams, screenshots and icons: images made of few, exact colours.

WebP (2010) is Google's replacement for both. It does lossy and lossless, transparency and animation, and it is meaningfully smaller than JPEG at the same visual quality. Every current major browser reads it. Upload forms and older desktop software often do not.

HEIC (2015) is what an iPhone saves by default. It is a HEIF container wrapping video-codec compression, and it is the most efficient of the four by a wide margin. It is also the one most likely to be rejected: many websites, Windows installations without the codec extension, and most non-Apple software cannot open it.

The same photograph, three formats

Five photographs, each fitted inside a 1600 px box and encoded three ways by the browser's own encoders. JPEG and WebP at quality 75; PNG has no quality setting, being lossless.

PixelsJPEG q75WebP q75PNGPNG vs JPEG
1600 × 1067159 KB96 KB −40%3522 KB22 ×
1200 × 1600498 KB445 KB −11%4023 KB8 ×
1200 × 1600161 KB77 KB −52%3159 KB20 ×
1200 × 1600329 KB244 KB −26%3809 KB12 ×
1202 × 1600281 KB185 KB −34%3831 KB14 ×

Two things stand out. WebP beat JPEG every time, but by very different margins: 11% on one photograph, 52% on another. And PNG was never remotely competitive.

PNG is not a photo format

No PNG setting closes a gap of eight to twenty-two times. PNG compresses by finding repetition: runs of identical pixels, rows that resemble the row above. A photograph has neither. Every pixel of sky is a slightly different blue, sensor noise makes neighbouring pixels disagree, and there is no repetition to exploit. PNG stores all of it faithfully, because that is its job.

If a 4 MB PNG of a holiday photo is refused by an upload form, converting it to JPEG will typically bring it under 200 KB with no visible difference. Here the conversion is simply the right format being used.

PNG earns its keep on the images it was built for: a logo, a chart, a screenshot of a form, anything with hard edges, large flat areas, or transparency that must be preserved. On those it is often smaller than JPEG, and it does not smear text into a grey haze.

One caveat, measured on a synthetic screenshot with a flat background, 28 lines of anti-aliased text and some rules: PNG came out at 177 KB against 138 KB for JPEG at quality 90. Anti-aliased text has hundreds of intermediate shades, so it defeats PNG's repetition trick too. Real screenshots of flat interfaces do much better; screenshots full of small text are a genuine toss-up.

Quality numbers do not transfer between formats

"Quality 75" means something different in each encoder, and comparing them is meaningless. Aiming two encoders at the same 200 KB ceiling on identical pixels:

PhotographJPEGWebP
1200 × 1600quality 80 → 198 KBquality 86 → 190 KB
1600 × 1067quality 81 → 198 KBquality 89 → 200 KB

WebP needed a higher number to land in the same place. The two quality scales are unrelated, so the only comparison worth making is at equal file size, by eye.

HEIC: the best format you cannot use

HEIC is roughly twice as efficient as JPEG, which is why Apple made it the default. It is also why people run into trouble: the photograph looks fine on the phone, and the government portal, the recruiter's applicant system or the print shop rejects it outright.

Your iPhone already converts on the way out in most cases: AirDrop to a Mac, or an email attachment, usually arrives as JPEG. What does not convert is a file copied off the device directly, or shared through an app that passes the original through. If a form refuses your photo without saying why, HEIC is the first thing to check.

You can also stop it at the source: Settings → Camera → Formats → Most Compatible makes the phone shoot JPEG. You lose about half the storage efficiency and gain a file that everything on earth can open.

What to actually pick

And the newer ones?

AVIF compresses better than WebP, particularly at small sizes, and browser support is now broad. JPEG XL is technically excellent and has had a rocky path through the browsers. Both are worth using on a site you control and worth avoiding anywhere a stranger has to open the file. The compatibility rule does not change: the further ahead of the audience you get, the more often something refuses to open.

Converting to JPEG under a limit? Compress to a file size →

Related guides