JPG vs PNG vs WebP vs AVIF — the practical guide

Four image formats, dozens of trade-offs, one decision per image. Here's how to pick the right one without spending an hour reading specs.

Pick the wrong image format and you waste bandwidth, ruin quality, or lose features you needed. Pick the right one and you barely think about it again. The frustrating part is that the "right" choice depends on context — there's no universal answer.

This guide gives you the practical rules. It skips the format history and the codec internals. You'll come out knowing exactly which format to use for a given use case.

The 30-second answer

  • Photos for the web? WebP (or AVIF if you want maximum savings and can deal with slightly slower encoding).
  • Photos for email or universal sharing? JPG.
  • Logos, icons, graphics with transparency? PNG, or WebP for smaller files.
  • Screenshots? PNG (or WebP lossless).
  • Animations? WebP (animated) or GIF.
  • Print or archival? Lossless: PNG, TIFF, or WebP lossless.

If that's all you needed, you're done. If you want the reasoning, read on.

The four formats compared

JPG (JPEG)

The grandfather of digital image formats. Released in 1992, refined ever since. Uses lossy compression specifically designed for photographic content — meaning it throws away some image data to achieve dramatic file size reductions, in ways that human eyes don't easily notice.

Pros: Universal support (every device, every email client, every legacy system). Excellent compression for photos. Predictable quality controls.

Cons: No transparency. Visible artifacts at low quality (especially around sharp edges and text). Compounding quality loss with repeated saves.

Use for: photographs, especially when compatibility matters or transparency isn't needed.

PNG

Created in 1996 specifically as a free, open alternative to GIF. Uses lossless compression — every pixel is preserved exactly. Supports transparency.

Pros: Lossless. Full alpha-channel transparency. Sharp edges and text remain crisp. Universal support.

Cons: Large file sizes for photographic content (often 5–10× a JPG of the same image). No animation in the standard.

Use for: logos, icons, screenshots, anything with text or sharp graphics, anything needing transparency, lossless archival.

WebP

Released by Google in 2010 to replace both JPG and PNG with a single format that's better at both jobs. Has lossy and lossless modes. Supports transparency and animation.

Pros: 25–35% smaller than JPG for photos at equivalent quality. 50–80% smaller than PNG for graphics. Full transparency. Animation support. Now supported in all modern browsers.

Cons: Slightly less universal than JPG/PNG (still issues with very old browsers, some legacy software). Encoding is slower than JPG.

Use for: the modern web in 2026. WebP is the right default for almost any image being served on a website today.

AVIF

The newest of the four, released in 2019 by the Alliance for Open Media. Uses the same compression technology (AV1) as the popular AV1 video codec.

Pros: Even smaller than WebP — often 50%+ smaller than JPG at the same quality. Better quality at low bitrates (no JPG-style blocking artifacts). HDR and wide color gamut support.

Cons: Encoding is computationally expensive (slow). Browser support is now broad (Chrome, Firefox, Safari since 16.4) but not yet universal. Tooling and ecosystem are less mature than WebP.

Use for: performance-critical sites where every kilobyte matters and you can afford slow encode times. Best paired with WebP and JPG fallbacks.

The decision tree

Run through these questions in order, and stop at the first "yes":

  1. Does this need to work in email clients or very old software? → Use JPG (for photos) or PNG (for graphics).
  2. Is this a logo, icon, or graphic with sharp edges? → Use PNG (or WebP lossless for smaller files).
  3. Does this need transparency? → Use PNG, WebP, or AVIF. Skip JPG.
  4. Is performance critical (millions of views)? → Use AVIF with WebP and JPG fallbacks via <picture>.
  5. Default web use? → Use WebP.

File size comparisons

Here's what the same photo looks like as each format. We took a 3000×2000 photo and exported each:

  • PNG (lossless): 5.8 MB
  • JPG (quality 95): 1.2 MB
  • JPG (quality 85): 480 KB
  • WebP (quality 85): 320 KB
  • AVIF (quality 85): 180 KB

AVIF is roughly 30× smaller than PNG and 2.5× smaller than JPG, for the same visual quality. The savings compound across an entire website.

What about HEIC?

HEIC is the format iPhones use to store photos. It's similar to AVIF in efficiency (slightly better, actually). The catch is that browser support for HEIC is essentially zero — only Safari renders it natively, and only in limited contexts. For anything other than storage on an iPhone, you should convert HEIC to one of the four formats above.

If you have iPhone photos in HEIC, use our HEIC to JPG converter for universal compatibility, or convert directly to WebP for the modern web.

The picture element pattern

If you're building a website and want maximum performance, you can serve multiple formats and let the browser pick the best one it supports:

<picture>
  <source srcset="hero.avif" type="image/avif">
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="..." width="1200" height="800">
</picture>

Modern browsers will use AVIF (smallest). Slightly older ones will use WebP. The few remaining ones will fall back to JPG. Everyone gets the best image their browser can render.

Common mistakes

  • Saving photos as PNG. A photo as PNG is huge for no benefit — you're paying 5-10× the bytes for visually identical results to JPG.
  • Saving logos as JPG. JPG compression smears sharp edges. Logos look blurry, and the file isn't even smaller than PNG.
  • Re-saving JPGs repeatedly. Each save loses more quality. If you'll edit again, work in PNG or TIFF and export to JPG only at the final step.
  • Not setting quality intentionally. The default quality settings in many tools are too high (95+). Most web images look identical at 80-85% with much smaller files.

Bottom line

For 90% of cases, you only need to decide between three formats:

  • JPG for photos shared widely
  • PNG for graphics with transparency
  • WebP for the modern web

Add AVIF if you're serving images to millions of people and every byte matters. Otherwise, WebP is the answer.


Convert between any of these with pictoolkit's free format converter. All conversion happens in your browser.

Keep reading

Related articles