What is a JPEG file?

The format that made digital photography practical, still the safest choice for a photograph, and still incapable of storing transparency.

JPEG at a glance

Extensions
.jpg, .jpeg — identical, the three-letter form is a DOS legacy.
Compression
Lossy only. There is no lossless JPEG mode in practice.
Transparency
None. No alpha channel of any kind.
Animation
None.
Colour depth
8 bits per channel, 24-bit colour.
Best for
Photographs and continuous-tone images.
Worst for
Screenshots, logos, text, line art, anything needing transparency.
Support
Universal. Every camera, browser, printer and application since 1992.

Understanding JPEG

What it is good at

JPEG was designed for photographs, and it remains excellent at them. It exploits two facts about human vision — that we resolve brightness better than colour, and coarse shapes better than fine texture — to discard information nobody misses.

The result is a photograph at a tenth of its lossless size with no visible difference at normal viewing. Thirty years of newer formats have improved on that by 25–50%, which is meaningful but not revolutionary. JPEG got the hard part right first.

The two things it cannot do

Transparency. JPEG has no alpha channel. When a transparent PNG is converted, every transparent pixel must become an actual colour, and most tools silently choose black — which is why logos exported to JPEG so often arrive inside an unwanted dark box.

Sharp edges. Describing an instantaneous jump from black to white requires an infinite series of wave patterns. JPEG keeps a finite number, and the truncated series overshoots around the edge, producing ringing — faint ghost echoes beside every letter. Chroma subsampling compounds it on coloured text.

Both are structural. No quality setting fixes either.

Generation loss

Every time a JPEG is decoded, edited and saved again, the encoder re-quantises data that has already been quantised. Errors from the previous pass are treated as real detail and given errors of their own.

This accumulates in one direction only. Saving an already-compressed JPEG at quality 95 does not restore anything — it just spends more bytes preserving the first pass's artefacts. The smeared, blotchy look of an image that has been through a dozen chat apps is generation loss.

The habit that avoids it: always compress from the highest-quality original you have, and do it once.

Where JPEG still wins in 2025

Compatibility, and it is not close. Every camera writes it, every printer accepts it, every email client displays it, and every piece of software written in the last thirty years opens it. WebP and AVIF are web formats; outside a browser their support is still patchy.

Decode speed is the other advantage. JPEG decoders are old, extremely optimised and frequently hardware-accelerated, which matters on low-powered devices displaying many images.

So: WebP or AVIF for images on a web page, JPEG for anything you send to a person, hand to a printer or attach to an email.

Settings worth knowing

Quality 75–85
The useful range for almost everything. Use 80 unless you have a reason not to.
Quality 90+
For images that will be printed or edited again. Wasteful on a web page.
Below 60
Visible blocking and banding. Placeholders only.
Progressive
Slightly smaller and much better on slow connections, above about 10 KB.
4:2:0 subsampling
The default, invisible on photographs, destructive on coloured text.

Try it yourself

Everything below runs in your browser, so you can test any of this on your own files without uploading them.

  • Compress JPEG

    Shrink JPG and JPEG photographs with a quality slider or an exact target size.

    Open the tool
  • JPG to WebP

    Typically 25–35% smaller at matched quality. The standard web win.

    Open the tool
  • PNG to JPG

    For photographs stored in the wrong container. Transparency is flattened deliberately.

    Open the tool

Questions

Frequently asked questions

Every answer below is present in the page source, expanded, so it can be read without opening anything.

What is the difference between .jpg and .jpeg?

Nothing whatsoever. They are the same format with the same bytes inside. The three-letter form exists because early Windows filesystems limited extensions to three characters, and it stuck.

Can a JPEG have a transparent background?

No. The format has no alpha channel, so transparency cannot be stored in any form. If you need it, use PNG or WebP — both carry a full 8-bit alpha channel.

Is there such a thing as a lossless JPEG?

There is a lossless mode in the specification, but effectively nothing supports it and no ordinary tool produces it. Where you see "lossless JPEG compression" advertised, it almost always means stripping metadata or losslessly rearranging the existing data with a tool like jpegtran — not lossless encoding of the image.

Why does my JPEG look worse every time I save it?

Generation loss. Each save re-quantises already-quantised data, so errors compound. Work from the original file and save once, rather than repeatedly re-saving the compressed copy.

Should I still be using JPEG in 2025?

For anything leaving the browser, yes — its universality is unmatched. For images on a web page, WebP is smaller at the same quality and supported by every current browser, so it is the better default there with JPEG as a fallback.

What quality setting should I use?

80 for general use. Raise it to 85–90 for images with large smooth gradients such as skies, which show banding earlier than textured images do. Lower it to around 70 for thumbnails, where the display size hides everything.

From the blog

Related reading

Longer, more practical guides from the blog.

  • Image Compression

    JPEG Quality Settings Explained: What the Number Actually Means

    Quality 80 is not 80% of anything. It is an index into a quantisation table. Measured on one photograph: dropping from 100 to 90 removes 77% of the file and 4.2 dB of fidelity; dropping from 40 to 30 removes 17% and costs almost as much.

    8 min read

  • Image Formats

    PNG vs JPEG: When to Use Each, With the File Sizes to Prove It

    PNG stored the same photograph in 1274.1 KB where JPEG needed 67.5 KB — nineteen times larger. On a flat graphic PNG won. On a smooth gradient PNG lost to JPEG by a factor of two, which surprises most people.

    9 min read

  • Image Formats

    WebP vs JPEG: Which Should You Use, and When JPEG Still Wins

    WebP produced a 27.0 KB file against MozJPEG's 41.1 KB on the same photograph at slightly higher measured fidelity — 34% smaller. It also produced a larger file than JPEG on random noise. The advantage is real and content-dependent.

    9 min read