Compress JPEG: How the Format Works, Measured

Compress JPEG files without wrecking them: how the lossy pipeline works, what the quality slider changes, and when to convert to WebP or AVIF instead.

By Mike Wiberg · · 18 min read

To compress JPEG photos, re-encode them at a lower quality setting, once, from the original. At quality 80, the setting worth trusting, a typical phone photo comes back 60 to 80 percent smaller with no change you can see. A browser compressor does it in seconds, nothing to install, no signup, and it strips the GPS data out on the way.

That paragraph settles most JPEG questions. The format has been doing quiet work since 1992, though, and it repays a fuller look. I built and run the compressor on this site, and JPEGs are most of what comes through it, so every number on this page is measured off the real tool, not quoted from someone else. This is the hub for the format: what a JPEG is, what happens to your pixels when you hit save, what the quality slider actually changes, how small a JPEG really gets, and when the smart move is to leave JPEG behind.

Here is the map. Every row is a section below.

If you want to Go to
Understand what a JPEG is What is a JPEG file
See what save does to your pixels What happens when you save a JPEG
Pick a quality number with confidence What does the quality slider change
Actually shrink one now How to compress JPEG files in the browser
Know how small it can get How small can a JPEG get
Decide JPEG vs WebP or AVIF Should you keep JPEG or convert

What is a JPEG file?

A JPEG is an image compressed with the standard published by the Joint Photographic Experts Group, the committee that issued it in 1992 (web.dev on the JPEG format). It is a lossy format, meaning it makes files small by throwing visual information away, and it is still the most widely used lossy still-image format there is (MDN image type guide). Every browser, phone, camera, and photo app opens one, a compatibility guarantee no newer format matches yet.

So what is JPEG in practical terms? A container for photographs, tuned for exactly that job and poor at most others.

The specs that matter

A JPEG stores 8 bits per color channel across three channels, which works out to 24-bit color and roughly 16.7 million possible colors. The MIME type is image/jpeg. The .jpg and .jpeg extensions are the same JPEG format with the same bytes inside; nothing changes between them except the file name. What the standard does not include is an alpha channel, so a JPEG cannot hold transparency, a limit that decides half of the "should this be a JPEG" questions on its own.

Where JPEG belongs, and where it does not

JPEG is built for continuous-tone images: photos, with their soft gradients and fine noise. It is the wrong tool for text, line art, charts, screenshots, and sharp-edged logos, which come out smeared and ringed at the block seams. The rule that falls out of that: photographs in JPEG, graphics in PNG.

What happens when you save a JPEG?

Saving a JPEG runs your pixels through six stages, and only two of them destroy information. Everything people notice about the format, the tiny files, the blocky artifacts when it goes wrong, the way a clear sky bands when you push too hard, comes out of those two stages.

Start with the raw material, because the scale of the job is easy to miss. A 12 megapixel photo is 12 million pixels at 3 bytes of color each, which is roughly 36 MB of uncompressed data. The 4.5 MB JPEG your phone actually writes has already squeezed that about 8 to 1 before you have touched a slider.

How does JPEG work? The six stages

Here is the JPEG compression pipeline, in order (Wikipedia on JPEG):

Stage What happens Detail lost?
Color conversion RGB becomes YCbCr, splitting brightness from color No
Chroma subsampling Color stored at lower resolution, usually 4:2:0 Yes, color detail
Block splitting Each channel divided into 8x8 pixel blocks No
DCT Each block rewritten as 64 frequency numbers No
Quantization Those numbers divided by a table and rounded Yes, the main loss
Huffman coding The rounded numbers packed losslessly No

Chroma subsampling and quantization: where the loss lives

The two lossy rows deserve plain English. Chroma subsampling works because your eye resolves brightness far more sharply than color, so JPEG keeps brightness at full resolution and stores color coarser. At the usual 4:2:0 setting the two color channels are halved in both directions, cutting them from two thirds of the file's data down to one third.

Quantization is the big one. The discrete cosine transform, or DCT, turns each 8x8 block into 64 numbers describing how much coarse and fine detail that block holds. Each number is divided by a value from a quantization table and rounded to the nearest integer, and the values for fine detail get divided by large numbers, so most of them round to zero. Long runs of zeros then pack down to almost nothing. That rounding is the loss. It is permanent, and it is exactly the dial the quality slider turns.

What does the quality slider change?

The quality number scales the quantization tables: a lower number means harsher rounding, more zeros, and a smaller file. It runs 0 to 100, it is not a percentage of anything, and it is not standardized, so quality 75 in one encoder does not mean what quality 75 means in another (web.dev). Treat it as a preference dial, not a measurement.

The useful range is narrow

The usable part of the scale is smaller than it looks. Google's web.dev team measured a case where quality 60 cut the file 79 percent, and found the differences across most of the scale imperceptible even in a side-by-side comparison (web.dev). In practice, 80 is the visually lossless default for photographs, 60 is the "smaller and still fine on a screen" setting, and below about 50 the compression starts to show its hand, first as blocking in smooth areas like skies, then as softness in skin and texture.

Why the same number looks different in two tools

Because the standard only defines what the quality value does to the math, not what any given number should look like, two encoders can read quality 70 differently. This is why a file exported at "70" from one app and "70" from another can differ in both size and appearance. Judge by the output size and a quick look, not by the slider position.

Why bother compressing a JPEG?

Three reasons, and they map to three different problems. On a website, smaller JPEGs load faster, and page speed is both a ranking input and the difference between a visitor who stays and one who leaves. In storage, a phone camera roll or a photo archive is almost entirely JPEG weight, so halving the files halves the bill. And for sharing, email services and upload forms enforce hard size caps that a raw 4.5 MB camera photo blows straight past.

Compression is not resizing

One distinction saves a lot of ruined images: compressing changes how the bytes are stored, resizing changes how many pixels exist. Dragging a corner handle in a document only changes the display size; the file underneath keeps every byte. When a photo is physically larger than anywhere it will be shown, resize first, then compress. When the dimensions are already right and only the bytes are too big, compression alone does it.

How to compress JPEG files in the browser

The fastest way to compress JPEG images is a browser compressor, because there is nothing to install and the defaults are already right. I use the one on this site here because I built it and can vouch for its numbers byte for byte.

  1. Open the JPG compressor and drop your photo on it. Up to 25 MB per image, up to 30 at once, no signup.
  2. Leave the quality at 80, the level the web treats as visually lossless for photographs.
  3. Read the after size on the result card. If you need it smaller, pull the quality slider down and watch the number fall until it fits. Re-running the same upload at a new quality or format never costs you anything.
  4. Download the result. The original on your device is untouched, and the copy you uploaded is deleted from our storage within the hour.

What happens to the file on the way through

Two useful things happen without you asking. EXIF data, the hidden metadata your camera writes into every file, including GPS coordinates and the exact moment you took the shot, is stripped by default. And the JPEG output is written progressive, so on a slow connection it renders in passes instead of loading top to bottom. Because the whole job runs in your browser and the uploaded copy is swept within the hour, nothing about the photo lingers on a server the way it does with upload-first tools.

How small can a JPEG get?

Smaller than most people expect, because the format is already doing heavy lifting before the quality slider enters the picture. Here is the same photo at three points in its life, measured on this tool in July 2026.

Stage Size Share of raw
Uncompressed RGB 36 MB 100%
Camera JPEG 4.5 MB 12.5%, about 8 to 1
Quality 80 0.9 MB 2.5%, about 40 to 1
One photo, three stages file size as a share of the raw uncompressed pixels Uncompressed 36 MB Camera JPEG 4.5 MB (8:1) Quality 80 0.9 MB (40:1) Measured with imagecompressor.tools, July 2026. Bar length proportional to bytes.

The camera already threw away five sixths of the raw data to reach 4.5 MB, and quality 80 takes another five sixths off that, landing near 0.9 MB with nothing you can see missing. That is the whole reason JPEG won: it is small enough, good enough, and openable everywhere.

When you need an exact number in KB

Some forms want a hard target, 200 KB for a passport photo, 100 KB for a listing, 50 KB for a government portal. That is the one case where you compress to a number instead of to a look, and quality alone rarely gets there from a full-size photo. The move is to cut the pixel dimensions first, then work the slider against the live after size. Reduce image file size in KB walks the exact-target workflow, and reduce JPEG size without wrecking it covers the artifact-diagnosis side when a previous compressor left a mess.

What is a progressive JPEG?

Progressive and baseline JPEGs use the identical lossy compression; the only difference is the order the data is stored and drawn. A baseline JPEG renders top to bottom, one clean strip at a time. A progressive JPEG stores its data in passes, so the whole image appears immediately at low detail and sharpens as the rest arrives. On a slow connection that is the difference between watching a photo load and staring at a blank box.

Progressive files also come out slightly smaller than baseline in most cases, at the cost of a little more decode work, and there is no quality tradeoff hiding in the choice because the pixels are the same either way. Our tool writes JPEG output as progressive by default for exactly those reasons.

What can a JPEG not do?

Two things: transparency and clean sharp edges. The JPEG standard has no alpha channel, so there is no such thing as a transparent JPEG, full stop. A logo saved as JPEG gets a solid background whether you wanted one or not, so anything that needs transparency belongs in PNG, WebP, or AVIF.

The second weakness is structural. That 8x8 block pipeline was tuned for the soft gradients of photographs, and it smears the hard edges in text, line art, charts, and interface screenshots, showing up as ringing and smudges along block seams right where a crisp edge used to be. PNG Explained covers that half of the split, including why PNG files run large and what to do about it.

The 8-bit ceiling

The 8 bits per channel limit matters at the edges too. It is plenty for a finished photo on a screen, but it is not enough headroom for heavy editing, which is why cameras shoot RAW and editors work in 16-bit formats before exporting a final JPEG.

Why does re-saving a JPEG make it worse?

Because every save re-runs the lossy stage on pixels that already went through it, and the losses stack. This is generation loss, and it works like photocopying a photocopy: each pass looks almost like the last, and ten passes in the damage is obvious (Cloudinary on JPEG generation loss).

Higher quality does not undo it

The counterintuitive part is that re-saving at a higher quality does not repair anything. Encode a quality 70 file at quality 95 and you get a larger file with more damage, not a restored one, because the encoder spends bytes faithfully preserving the compression artifacts that are already baked in.

What is actually safe

The reassuring part: opening, viewing, renaming, copying, and moving a JPEG are all harmless. Loss happens only when the image is re-encoded. So the fix is a workflow, not a tool. Keep the original, do your editing in a lossless format like PNG or TIFF, and export to JPEG once, as the last step. If you must re-save a JPEG, match the source quality rather than raising it.

Should you keep JPEG or convert to WebP or AVIF?

Convert what you publish, keep JPEG for what you send. WebP is typically 25 to 35 percent smaller than a JPEG of the same visual quality, and AVIF is often around 50 percent smaller, at the cost of slower encoding. The demo file on our home page is the concrete case: a 497 KB JPG comes out a 214 KB WebP at quality 80, which is 56.9 percent smaller with the same picture on screen. On a website, that saving lands on every visitor, every load.

Format Compression Vs JPEG Best for
JPEG Lossy baseline Photos going anywhere old or unknown
PNG Lossless larger Screenshots, logos, text, transparency
WebP Both 25 to 35% smaller The modern default for the web
AVIF Both about 50% smaller Maximum savings where support is known

Where JPEG still wins

JPEG keeps two advantages. Compatibility is the first: email clients, older software, and picky upload portals all expect it, so a file headed into other people's hands is safest as a JPEG. Encoding speed is the second, which matters when you process thousands of images at once. The full head-to-head, including where AVIF's slow encode earns its keep, lives in WebP and AVIF, the modern formats. In the tool itself, format is an output dropdown, so trying WebP against your JPEG costs nothing but a glance at the after size.

JPG vs JPEG: are they the same?

They are the same format, byte for byte. The extension .jpg exists only because early Windows and DOS filenames were capped at three characters, so .jpeg got trimmed to .jpg, and the shorter spelling stuck. The MIME type is image/jpeg for both, every editor treats them interchangeably, and renaming one to the other changes nothing about the image. JPG vs JPEG: same thing, one letter has the full story, including the one case where letter case in the extension can trip up a strict server.

Every JPEG guide on this site

This page is the map; the guides below are the territory, grouped by the job in front of you.

Make a JPEG smaller:

Get something else into JPG:

The sibling pillars cover the neighboring formats: PNG Explained for lossless and transparency, and WebP and AVIF for the modern web formats that beat JPEG on size.

Questions

How do I compress a JPEG file size?

Run the JPEG through a compressor at quality 80, which returns a typical phone photo 60 to 80 percent smaller with no visible change. If it is still over a limit, pull the quality slider down while watching the output size, or cut the pixel dimensions first for a strict KB target. Always work from the original file, because recompressing an already compressed JPEG stacks the losses.

Is JPG the same as JPEG?

Yes. The extensions .jpg and .jpeg point to the identical format, the same standard, and the same bytes, and the MIME type is image/jpeg either way. The short spelling exists only because old filenames were capped at three characters. Renaming one to the other changes nothing about the image, so pick whichever a form or system asks for and move on.

What quality setting should I use to compress a JPEG?

Use 80 for photographs; it is visually lossless at normal viewing size and is the default on our tool. When a hard file size limit is in play, pull the slider down while watching the output size until it fits. Below roughly 50 the compression starts to show, first as blocking in smooth areas like skies, so treat that as the floor for anything anyone will look at closely.

Does a JPEG lose quality every time you open it?

No. Opening, viewing, copying, renaming, and moving a JPEG never touch the image data. Quality is lost only when the file is re-encoded, meaning you edit and save it or a tool recompresses it. One save costs one generation of loss, so the goal is to make saves rare and deliberate, and to keep the untouched original somewhere safe.

Can a JPEG have a transparent background?

No. The JPEG standard has no alpha channel, so transparency is impossible in the format regardless of the tool. Anything transparent placed into a JPEG gets flattened onto a solid background. For logos, cutouts, and overlays, use PNG for maximum compatibility or WebP for smaller files with the same transparency support.

Ready to shrink that JPEG?

JPEG has held the default spot for photographs for more than thirty years by being small enough, good enough, and openable everywhere, and the way to get the most out of it is simple: compress once, from the original, at a quality the destination deserves. Start at 80, check the after size against your limit, and step down or resize only when the number says you must. When the file in front of you is over a limit right now, drop it on the JPG compressor and pull the slider until it fits. It is free for up to 30 images at a time, and the copy you upload is gone within the hour.