PNG vs JPG vs WebP vs HEIC vs AVIF: Which Image Format Is Best?
Quick Answer: Which Should You Use?
- For modern websites: AVIF — ~50% smaller than JPG, supported in all major browsers
- For maximum compatibility: JPG — universal support, acceptable everywhere
- For iPhone photos: HEIC — Apple's native format, best storage efficiency for personal libraries
- For graphics with transparency: PNG — lossless, pixel-perfect, and universally supported
What Are These Formats?
JPG (JPEG)
Created in 1992, JPG is the most widely used image format in the world. It uses lossy compression to reduce file sizes while maintaining acceptable visual quality. Virtually every device, browser, and application supports JPG. It's the universal fallback — when in doubt, JPG works.
PNG (Portable Network Graphics)
Created in 1996 as a replacement for GIF, PNG uses lossless compression — meaning no quality is lost when you save. It supports transparency (alpha channel), making it the go-to format for logos, icons, screenshots, and graphics with sharp edges. The tradeoff: file sizes are significantly larger than lossy formats. PNG is not designed for photos.
WebP
Developed by Google in 2010, WebP was the first modern format to deliver both lossy and lossless compression in one codec. Lossy WebP images are 25-35% smaller than equivalent JPGs at the same quality. Lossless WebP is about 26% smaller than PNG. It also supports transparency and animation. As of 2026, WebP is supported by 96%+ of browsers worldwide — it's the safe, modern baseline.
HEIC (High Efficiency Image Container)
Apple's default photo format since iOS 11 (2017). Based on the HEIF standard, it uses HEVC (H.265) compression for images. Produces files 40-50% smaller than JPG at equivalent quality, with support for Live Photos, burst mode, and depth maps. The catch: outside the Apple ecosystem, compatibility is limited — browsers don't render it, and Windows requires a paid extension.
AVIF (AV1 Image File Format)
The newest addition to the family, AVIF is based on the royalty-free AV1 video codec. It delivers roughly 50% smaller files than JPG at equivalent quality — meaning a 100 KB JPG can become a 50 KB AVIF with no visible difference. AVIF also supports transparency (alpha), lossless mode, HDR, 12-bit color depth, and animation. Browser support crossed 90% in 2025, and as of 2026 it's ready for production use. AVIF is the new standard.
File Size Comparison
We tested a real photo and a logo graphic across all five formats. Here's the methodology:
- Photo: Street scene — a 3024 × 4032 pixel photo taken with an iPad (original HEIC)
- Logo: A 1200 × 630 pixel graphic with transparency (PNG source)
- Conversion: Each format was encoded at visually equivalent quality using ImageMagick (which uses libjpeg-turbo for JPG, libwebp for WebP, and libsvtav1 for AVIF) and libheif for HEIC. JPG at quality 80, WebP at 82, AVIF at 70, HEIC at 50 — settings that produce comparable visual fidelity as measured by dssim (structural similarity metric).
Photo (Lossy Compression)
| Format | Quality | File Size | vs JPG | dssim |
|---|---|---|---|---|
| AVIF | 70 | 2,083 KB | −17.6% | 0.00124 |
| HEIC | 50 | 2,120 KB | −16.2% | 0.00127 |
| WebP | 82 | 2,282 KB | −9.8% | 0.00160 |
| JPG | 80 | 2,529 KB | — | 0.00138 |
| PNG | lossless | 16,671 KB | +559% | — |
dssim measures visual difference from the original image. Lower scores = closer to the source. All lossy formats score below 0.01, meaning they are virtually indistinguishable from the original (dssim uses the formula 1/SSIM − 1).
What do dssim scores mean?
| dssim | SSIM | Interpretation |
|---|---|---|
| < 0.01 | > 0.99 | Virtually indistinguishable |
| 0.01 – 0.05 | 0.95 – 0.99 | Excellent — differences imperceptible |
| 0.05 – 0.11 | 0.90 – 0.95 | Good — barely noticeable on close inspection |
| 0.11 – 0.25 | 0.80 – 0.90 | Fair — visible degradation |
| > 0.25 | < 0.80 | Poor — obviously different |
Thresholds derived from the SSIM metric (Wang et al., 2004), converted to dssim's 1/SSIM − 1 formula. The commonly cited benchmark: SSIM below 0.95 is perceptible to most viewers.
Why different quality numbers?
The "quality" parameter is not standardized across codecs — it's a codec-specific knob that controls an internal quantization table, and each codec maps this number to compression differently. JPEG's quality parameter, for instance, scales a default quantization matrix defined in the original JPEG standard, but the scale itself is implementation-dependent. A "quality 80" in JPEG, WebP, and AVIF does not represent the same visual fidelity or compression level. To make a fair comparison, we match the quality settings that produce images with equivalent visual difference from the source — a methodology validated by Malte Ubl's research (using dssim) and by Netflix's AVIF benchmarking (using SSIM and VMAF objective quality metrics). Our dssim measurements show: JPEG quality 80 ≈ WebP quality 82 ≈ HEIC quality 50 ≈ AVIF quality 70 for visually equivalent output.
Result: At visually equivalent quality, AVIF and HEIC are nearly tied at ~17% smaller than JPG, with WebP at 10% smaller — meaningful savings that translate to faster page loads. PNG is nearly 7× larger, confirming it's the wrong choice for photographs.
But What About the Original HEIC?
The table above shows a re-encoded HEIC at 2,120 KB — competitive with AVIF. But the original iPad HEIC capture of this photo is 3,203 KB, which is larger than JPG q80 (2,529 KB) and 51% larger than the re-encoded version. This seems to contradict the claim that HEIC is more efficient than JPG. But the table already shows the answer: when encoded at matched visual quality, HEIC is 16% smaller than JPG. The difference comes down to Apple's chosen quality target.
Apple's HEIC encoder targets a much higher fidelity level than a typical web JPG. We can measure this by re-encoding the same image as JPG at progressively higher quality levels and comparing via dssim:
| Image | File Size | vs HEIC | dssim |
|---|---|---|---|
| iPad HEIC (original) | 3,203 KB | — | 0.00000 |
| JPG q80 | 2,529 KB | −21.0% | 0.00138 |
| JPG q90 | 4,111 KB | +28.4% | 0.00058 |
| JPG q95 | 5,768 KB | +80.1% | 0.00021 |
| JPG q98 | 7,886 KB | +146.2% | 0.00007 |
JPG q80, at dssim 0.00138, is excellent by any practical standard — well within the "virtually indistinguishable" range. But quantitatively, it's measurably further from the camera sensor output than what HEIC preserves. To close that gap, JPG must push to quality 95 (5,768 KB, 80% larger) or beyond — quality 98 reaches dssim 0.00007, but at 7,886 KB, nearly 2.5× the HEIC original. And JPG can never truly reach zero: its 8-bit DCT pipeline has a fidelity floor that HEIC's modern HEVC-based codec doesn't.
The bottom line: Apple chose a quality target where HEIC operates efficiently and JPG struggles. At matched fidelity, HEIC is dramatically smaller. Apple simply decided that preserving camera sensor detail was worth the bytes — and left the aggressive space-saving to formats like AVIF and WebP, which are purpose-built for web delivery.
Logo with Transparency (Lossless)
| Format | Quality | File Size | vs PNG | dssim |
|---|---|---|---|---|
| AVIF | 70 | 8.2 KB | −86.8% | 0.00033 |
| WebP | 82 | 10.4 KB | −83.3% | 0.00086 |
| JPG | 80 | 20.7 KB | −66.8% | 0.00054 |
| PNG | lossless | 62.3 KB | — | — |
Result: For graphics with transparency, AVIF and WebP dramatically outperform PNG — AVIF at 8.2 KB is 87% smaller than the 62.3 KB PNG source. All lossy formats score below 0.001 dssim, confirming negligible visual difference. Note: JPG cannot preserve transparency (alpha is replaced with white background), so it's not a valid alternative for logos with alpha. For pixel-perfect results, PNG remains the lossless choice; for the web, AVIF or WebP deliver massive savings.
Quality Comparison
Our benchmarks above show one specific photo at matched quality — a single data point. For a broader picture, we turn to the SPCP Benchmark (2025) — the most comprehensive academic comparison of still-image codecs to date, covering 10 formats across 408 encoder configurations and 28 objective quality metrics. We highlight its BD-Rate results here. BD-Rate measures the average bitrate savings one codec achieves over another at equivalent quality (PSNR), integrated across the full quality range. A negative number means the format is more efficient:
| Comparison | BD-Rate (PSNR) | What this means |
|---|---|---|
| AVIF vs JPEG | −57% | AVIF needs roughly half the file size to match JPEG's quality |
| HEIC vs JPEG | −50% | HEIC is on par with AVIF — both are modern HEIF-based codecs |
| WebP vs JPEG | −29% | WebP is a meaningful upgrade, but a generation behind AVIF/HEIC |
| AVIF vs WebP | −37% | The AVIF–WebP gap is larger than WebP's entire advantage over JPEG |
These are averages across the Classic image dataset (20 standard test images). The full interactive benchmark is available at fukushimalab.github.io/spcp/.
What drives these differences? The hierarchy reflects codec generations, not just encoder tuning:
- JPEG (1992): 8-bit DCT with fixed 8×8 blocks. Still competitive at high bitrates, but blocking and ringing artifacts appear below ~70% quality. Universal compatibility remains its strongest asset — no other lossy format works everywhere.
- WebP (2010): Derived from Google's VP8 video codec. A real improvement over JPEG, but constrained by 8-bit color depth and forced chroma subsampling (4:2:0) in its best-compression mode — saturated color edges can appear smudged even at maximum quality.[1]
- HEIC (2013) & AVIF (2019): Both pair the modern HEIF container with a video-codec compression engine — H.265/HEVC for HEIC, AV1 for AVIF. Both support 10/12-bit color, full-resolution chroma, and HDR. Their compression efficiency is comparable (within ~7 percentage points). The practical difference is licensing: HEIC is patent-encumbered (MPEG LA), while AVIF is royalty-free (Alliance for Open Media).[1]
Netflix's independent image compression comparison framework, using their perceptually-trained VMAF metric, confirms the same ranking — AVIF > HEIC > WebP > JPEG — across different test images and methodologies. The result is robust.
Compatibility Matrix
| Platform | PNG | JPG | WebP | HEIC | AVIF |
|---|---|---|---|---|---|
| Chrome | ✅ | ✅ | ✅ | ❌ | ✅ |
| Safari | ✅ | ✅ | ✅ | ✅ | ✅ (iOS 16+) |
| Firefox | ✅ | ✅ | ✅ | ❌ | ✅ |
| iPhone/iPad | ✅ | ✅ | ✅ (iOS 14+) | ✅ (default) | ✅ (iOS 16+) |
| Android | ✅ | ✅ | ✅ | ✅ (9+) | ✅ (12+) |
| Windows | ✅ | ✅ | ✅ (10+) | ⚠️ (paid ext) | ✅ (10+) |
| macOS | ✅ | ✅ | ✅ | ✅ (High Sierra+) | ✅ (Ventura+) |
| WordPress | ✅ | ✅ | ✅ (5.8+) | ❌ | ✅ (6.5+) |
Winner: JPG and PNG are universally compatible — they work everywhere, always. AVIF and WebP have reached broad enough support for production use on the web (90%+ global coverage). HEIC remains the compatibility outlier — great format, locked to Apple's ecosystem.
Feature Comparison
| Feature | PNG | JPG | WebP | HEIC | AVIF |
|---|---|---|---|---|---|
| Lossy Compression | ❌ | ✅ | ✅ | ✅ | ✅ |
| Lossless Compression | ✅ | ❌ | ✅ | ✅ | ✅ |
| Transparency (Alpha) | ✅ | ❌ | ✅ | ✅ | ✅ |
| Animation | ❌ | ❌ | ✅ | ✅ | ✅ |
| HDR / Wide Color | ❌ | ❌ | ❌ | ✅ | ✅ |
| 12+ bit Color Depth | ✅ | ❌ | ❌ | ✅ | ✅ |
| Metadata (EXIF) | ✅ | ✅ | ✅ | ✅ | ✅ |
When to Use Each Format
Use AVIF When:
- Serving images on a modern website (use <picture> with JPG fallback)
- You want the absolute best quality-to-file-size ratio
- You need HDR or wide color gamut support
- You're building a new project and can use modern tooling
Use WebP When:
- You need a modern format with slightly broader legacy support than AVIF
- You need transparency with smaller files than PNG
- You're supporting a small subset of older iOS/macOS users (pre-2022)
Use JPG When:
- Maximum compatibility is required (government portals, exam systems, print labs)
- Sending photos to Windows users who may not have modern image viewers
- Uploading to platforms that don't accept modern formats (some social media, legacy CMS)
- You need the universal fallback — JPG works everywhere, no exceptions
Use HEIC When:
- Taking photos on iPhone (Apple's default, best storage efficiency)
- Storing personal photo archives on Apple devices
- Sharing photos within the Apple ecosystem (AirDrop, iMessage)
- You need Live Photos, burst mode, or depth data
Use PNG When:
- Your image needs transparency and universal compatibility (logos, icons, overlays)
- You're saving screenshots, diagrams, or graphics with sharp edges and text
- Lossless quality is non-negotiable (medical imaging, design source files)
- You're creating assets that other people will edit — PNG is the archival-safe graphics format
How to Convert Between Formats
HEIC to JPG
Use our format converters — all free and privacy-first: HEIC to JPG, HEIC to PNG, HEIC to PDF, AVIF to PNG, and WebP to GIF. All processing happens locally in your browser, no uploads required.
PNG to JPG
Use our image compressor and select "Maximize compatibility" mode. This converts PNG to JPG while compressing — ideal when you don't need transparency and want a smaller file for the web.
JPG, PNG, or WebP → Smaller File (Same Format)
Use our image compressor with "Keep format" mode. It keeps the original format and reduces file size through quality optimization. For best results, try our image resizer first — downsizing a 4000px photo to 1200px before compression saves dramatically more space.
PNG to WebP
Use our image compressor and select "WebP" mode. For logos and graphics with transparency, PNG → WebP typically saves 80-90% with no visible quality loss — one of the highest-impact optimizations for websites with logos.
HEIC to WebP
Convert HEIC to JPG first using our HEIC converter, then use our image compressor with WebP mode. Two steps, but gives you full control over quality at each stage.
What's Beyond AVIF? JPEG XL
While AVIF is still establishing itself as the production standard, JPEG XL is already gaining attention as a potential successor. It offers unique advantages: lossless recompression of existing JPGs (a 20% size reduction with zero quality loss), progressive decoding, and better performance at very high resolutions. Google briefly shipped JPEG XL in Chrome 91-109 before removing it, but community pressure and ecosystem demand may bring it back. For now, AVIF is the practical choice — supported, efficient, and ready today.
Conclusion
Here's the practical 2026 playbook:
- Use AVIF on your website with a JPG fallback via <picture> — it's the new standard for web images
- Use WebP if you need a mature modern format with slightly wider compatibility than AVIF
- Use JPG as the universal fallback — maximum compatibility, works everywhere
- Shoot in HEIC on your iPhone to save storage space
- Use PNG for logos, icons, and graphics that need lossless transparency
Need to convert or compress? Try our free privacy-first image tools — all processing happens in your browser.