Files, Storage and Formats

Image Formats Explained: JPEG, PNG and WebP

Compare JPEG, PNG and WebP by file size, quality and transparency, and learn which picture format usually suits photos, screenshots and web graphics.

On this page
  1. What these formats have in common
  2. JPEG
  3. PNG
  4. WebP
  5. A quick comparison
  6. Choosing in practice
  7. Other things that affect file size

What these formats have in common

JPEG, PNG and WebP are all ways of storing a still picture as a grid of coloured dots, called pixels, in a compact form. They differ in how they shrink that information, and that choice decides how large the file is, how the picture looks, and whether parts of it can be see-through.

Before comparing them, it helps to know the two kinds of shrinking. Lossless formats keep every pixel exactly, and lossy formats discard some detail to save space. Here the focus is on what that means for pictures.

JPEG

JPEG, also written JPG, is a lossy format designed for photographs. It works by simplifying small differences in colour and fine detail that the eye is less likely to notice. Photos have smooth gradients and complex textures, so JPEG can often make them far smaller than a lossless format would.

Strengths:

  • Good for photographs, with small files at reasonable quality.
  • Supported almost everywhere, including every camera, phone and web browser.
  • Adjustable quality, so you can pick a balance between size and appearance.

Limits:

  • It has no transparency. Every pixel is a solid colour.
  • Sharp edges, text and flat-colour graphics can show fuzzy halos or blotches, especially at lower quality settings.
  • Each time you edit and re-save a JPEG, a little more quality can be lost, so it is better to edit from an original and save a JPEG at the end.

PNG

PNG is a lossless format. It stores the picture without discarding detail, so what you save is what you get back. It also supports transparency, including smooth partial transparency, which is why logos and icons with soft edges are often PNG files.

Strengths:

  • Crisp results for screenshots, diagrams, text, and graphics with flat areas of colour.
  • Transparency, so the image can sit on any background.
  • No quality loss on repeated saving.

Limits:

  • Photographs usually produce much larger PNG files than JPEG files, sometimes several times larger, because photographic detail does not compress well without loss.
  • It is a poor choice when you simply need a small photo to share or upload.

WebP

WebP is a newer format developed to be efficient on the web. A notable thing about it is that it can work in either mode: it has a lossy mode similar in spirit to JPEG and a lossless mode similar in spirit to PNG. It also supports transparency in both modes, and it can store animations.

Strengths:

  • Often produces smaller files than JPEG or PNG at comparable visual quality, though the difference depends on the picture and the settings.
  • One format that can cover photos, graphics and transparent images.
  • Widely supported by current web browsers.

Limits:

  • Support in older software, some editing programs and some devices is less universal than for JPEG and PNG. You may occasionally find a WebP image will not open or will not upload where a JPEG would.
  • Saving a downloaded web image often gives you a WebP, which surprises people who expected a JPEG.

A quick comparison

JPEG PNG WebP
Compression Lossy Lossless Lossy or lossless
Transparency No Yes Yes
Animation No Not in the basic format Yes
Typical best use Photos Screenshots, logos, graphics Web images of all kinds
Compatibility Very high Very high High, but not total

Choosing in practice

  • A photo to email or post: JPEG is the safe, broadly accepted choice. WebP can save space where it is accepted.
  • A screenshot with text: PNG usually looks sharper and avoids the smudging around letters.
  • A logo on a coloured background: PNG or WebP, because you want transparency.
  • A website image: WebP is a common choice for smaller downloads, often with JPEG as a fallback for compatibility.
  • An image you will edit later: keep a lossless original and make lossy copies for sharing.

Other things that affect file size

The format is only part of the story. Image dimensions matter a lot: a picture that is twice as wide and twice as tall has four times as many pixels. Resizing a picture to the size you actually need is often the quickest way to shrink it. Quality settings, and whether metadata such as location and camera details are kept, also change the result. If you are sharing photos, it is worth knowing that location data stored in a file can reveal where it was taken, which is part of protecting your online privacy.

There are other formats worth knowing about, such as HEIC on many phones, GIF for simple animations, and camera RAW files used by photographers. They follow the same logic of trading size, quality and compatibility. If a file refuses to open, checking its extension and the file formats your software supports is the first step.

None of the three is best in every case. JPEG is the dependable photo format, PNG preserves sharp graphics exactly, and WebP often gets the smallest result where it is supported.

The complete guide to files, storage and formats

A Plain Guide to Digital Files, Folders and Formats
Read the guide

Keep exploring

Guides from other topics

All topics →