How-to

How to Reduce JPG File Size Without Losing Quality

Your photo weighs 8 MB, won't upload to a form, and is slowing your site to a crawl — sound familiar? Good news: in 90% of cases a JPEG can be shrunk several times over and you simply won't see the difference. Bad news: people crank quality to 100 and then wonder where the megabytes came from. Let's walk through the levers that actually work — from quality to resizing — and exactly how much each one saves.

A designer optimizing a photo in an image editor on a desktop computer
Compressing a JPG with no visible quality loss is about the right settings, not expensive software. Photo: Pexels

Why a JPG gets so heavy

JPEG is a lossy format. It throws away fine detail the human eye barely registers in order to make the file smaller. So a JPG should be light by definition, right? Then where do 5–10 MB photos come from?

There are usually three reasons, and they stack:

  • Quality set too high. Cameras and editors save JPEG at quality 90–100 by default. That's "honest," but excessive: the difference between 80 and 100 is invisible to the eye, yet the file is 2–3 times heavier.
  • Huge resolution. A modern phone shoots a 4000×3000-pixel frame or larger — 12+ megapixels. If that photo is then shown in a post 1080 px wide, you're carrying three quarters of the pixels for nothing.
  • Extra data inside. EXIF (camera model, settings, GPS coordinates), color profiles, an embedded thumbnail — all of it lives inside the file and piles on kilobytes.

The big idea

JPEG size is governed by four levers: the quality level, the resolution, the metadata, and the encoding method. The biggest win almost always comes from resizing, and the most common mistake is saving at quality 100. We'll cover each lever in turn.

Quality 60–80: the main lever

JPEG has a quality parameter — a number from 1 to 100 that controls how aggressively the format discards detail. And here's the key fact that saves the most: quality 100 is almost never needed.

For the web and ordinary photos, the sweet spot is quality 60–80. A shot saved at 80 is indistinguishable from the original by eye, yet it weighs 2–3 times less. The reason is simple: the top quality values spend an enormous amount of data on differences that sit below the threshold of human perception.

60–80optimal quality for the web
2–3×saving vs. quality 100
<60where visible artifacts begin

Where's the line? Below quality 60, gradients (sky, skin, smooth transitions) and the area around sharp edges sprout the telltale "blocks" and halos — block-compression artifacts. That's the very "quality loss" everyone fears. So the practical rule is:

  • 85–80 — when every detail matters: portfolios, small prints, text-heavy previews.
  • 80–70 — the universal range for websites and social media. The best size-to-quality balance.
  • 70–60 — backgrounds and secondary images, where saving bandwidth beats perfection.

Don't re-save in a loop

JPEG loses quality with every re-save — this is called generation loss. Open a photo, tweak it, save, open again, save again — and the artifacts pile up. Keep the original separately and make the compressed version from it once.

A person reviewing a photo library on a large screen before export
Before exporting, settle two questions: what display size you actually need, and what quality is good enough. Photo: Pexels

Resizing: the most underrated trick

If you take one tip from this whole article, make it this one. Reducing the resolution to match the real display size shrinks the file more than anything else — by 80–90%.

The logic is airtight. A JPEG's size grows in proportion to the number of pixels. A 4000×3000 frame is 12 million pixels. If the image is displayed on the page at 1200 px wide (that's 1200×900 ≈ a little over a million pixels), you're storing and shipping ten times more data than necessary. Nobody will ever see those extra pixels — the screen downscales them anyway.

Resize first, then set quality

Order matters. If you first shrink the resolution to what you need and only then set quality 75, you stack both wins. That's exactly how a 6 MB photo becomes a tidy 150–250 KB with no visible difference.

What dimensions should you target? Base it on where the image actually lives:

Where it's usedSensible widthNote
Avatar, icon200–400 pxAnything more is wasted
Image in a post / article1200–1600 pxWith headroom for Retina screens
Full-width background / hero1920–2560 pxBeyond this the gain is tiny
Email / chat attachment1600–2048 pxEnough to make out the detail

The rule is simple: there's no point storing an image wider than the slot it appears in (allow ×2 for high-density displays). Everything beyond that is dead weight.

Compress online in 30 seconds

If you need to shrink a few photos right now without fiddling with software, the fastest route is an online converter. It runs in the browser, there's nothing to install, and you can switch JPEG to a more efficient format in the same step.

1

Upload your JPG

Drag the files into the converter window. Several at once is fine.

2

Pick format and quality

WebP at quality ~80 weighs less than JPEG for the same picture.

3

Download the result

Finished files in a couple of seconds — one by one or as an archive.

Shrink your JPGs right now

The FormatZ converter turns a heavy JPEG into a light WebP in a couple of seconds — right in your browser, with no install and no sign-up. The simplest way to cut a photo's size several times over.

Compress JPG to WebP

If you need a lossless format instead — for graphics or text-heavy screenshots, say — the JPG to PNG converter has you covered. And the full list of conversions is always on the all formats page.

mozjpeg and jpegoptim for your own files

When you need to process hundreds of photos or bake compression into a site build, command-line tools take over. They work in batches, repeatably, and squeeze the most out of JPEG.

mozjpeg is an improved JPEG encoder from Mozilla. At the same visual quality it produces files roughly 5–15% smaller than the standard encoder, thanks to trellis quantization and smart progressive coding. It encodes more slowly than usual, but for batch work that doesn't matter. The command:

cjpeg -quality 80 -optimize -progressive input.jpg > output.jpg

Here -quality 80 sets the quality level, -optimize builds optimal Huffman tables, and -progressive makes the file progressive (more on that below).

jpegoptim is the tool when you want to squeeze already-finished JPEGs without re-encoding from scratch. It optimizes the Huffman tables (this is lossless) and can also enforce a quality ceiling. A few handy variants:

# Lossless: rebuild tables + strip metadata only
jpegoptim --strip-all photo.jpg

# With a quality ceiling of 80 and progressive output
jpegoptim --max=80 --all-progressive photo.jpg

# Squeeze under a size limit (e.g. 250 KB)
jpegoptim --size=250k photo.jpg

Which to choose

Want to re-encode from scratch and squeeze the maximum — mozjpeg (cjpeg). Need to gently trim existing files and strip metadata with no visible loss — jpegoptim. There's also jpegtran (lossless operations like rotation and converting to progressive) and Google's guetzli — it produces compact files but runs very slowly and eats memory, so real pipelines rarely use it.

A photographer processing shots on a laptop beside an external drive and prints
Batch optimization is a lifesaver when you need to prep a whole shoot for publishing, not just one frame. Photo: Pexels

Progressive JPEG and stripping metadata

Two techniques that aren't the biggest win, but are essentially free and improve perception.

Progressive JPEG. A regular (baseline) JPEG loads top to bottom, line by line. A progressive one is encoded differently: it first shows a blurry version of the whole image, which gradually sharpens. The benefit is twofold — on a slow connection the user immediately sees what's loading, and the file is often a touch lighter than the baseline version. Turn it on with -progressive in cjpeg or --all-progressive in jpegoptim.

Stripping metadata. Inside almost every JPEG lives EXIF — technical info about the shot. There you'll find the camera model, shutter speed, ISO and, more importantly, often the GPS coordinates of where it was taken. This data:

  • takes up space — tens of kilobytes, especially with an embedded thumbnail and color profile;
  • leaks privacy — publishing a geotagged photo effectively announces where you are.

The command jpegoptim --strip-all photo.jpg removes the clutter in one move. For any photo headed to the internet, that's almost always the right call.

Metadata is kilobytes you hand over for free, and a location you hand over without noticing. Stripping it is almost always worth it.

When WebP or AVIF beats JPEG

Sometimes the most effective way to "compress a JPG" is to stop using JPEG. The format is over 30 years old, and modern codecs beat it on efficiency by a wide margin.

FormatSize at the same qualityWhen to use
JPEGbaseline (100%)Maximum compatibility; format can't be changed
WebP25–35% lighterThe universal choice for the web today
AVIFabout 50% lighterWhen you need minimum weight and the tooling supports it

At the same visual quality, WebP is roughly 25–35% lighter than JPEG, and AVIF about 50%. Both are supported in every current browser, so switching to them for a website is almost always a win for load speed and disk space.

When should you stay on JPEG? If you need absolute compatibility (old software, email clients, government portals) or the file format can't be changed by requirement. In every other case, for the web it's sensible to convert photos to WebP. For graphics, screenshots and images with transparency, PNG fits — but for photographs it's actually heavier than JPEG, so you'd choose it for reasons other than size.

Checklist: what to do right now

Short and ordered — from the most powerful move to the fine print:

1

Reduce the resolution

To the real display size (×2 for Retina). This gives −80–90% of the weight.

2

Set quality 75–80

Indistinguishable from 100 by eye, yet 2–3 times lighter.

3

Strip the metadata

--strip-all: minus the kilobytes and minus the geotag.

4

Enable progressive

Slightly lighter, and a nicer load on a slow connection.

5

Consider WebP/AVIF

For the web that's another −25–50% at the same quality.

Do the first two and, in most cases, the "JPG is too heavy" problem is solved. The rest is fine-tuning for those who want to squeeze out the maximum.

Fully lossless only if you optimize the Huffman tables and strip metadata: the file drops by 5–15% while the pixels stay untouched. Everything that saves more (lowering quality, resizing) technically introduces loss, but at quality 60–80 and a sensible resolution you won't see it. In practice, "no quality loss" means "no visible difference."
For the web and most photos the sweet spot is 60–80. Quality 80 is usually indistinguishable from 100 by eye, yet the file is 2–3 times smaller. Below 60 you start to see artifacts on gradients and sharp edges. Saving at 95–100 is almost always wasteful — you pay megabytes for a difference nobody can see.
Usually resizing. A 4000×3000 camera photo is shown on a site at 1200–1600 px wide, and the extra pixels still weigh something. Resizing down to the actual display size cuts the file by 80–90%. Next comes the quality level (60–80), then stripping metadata and progressive encoding.
Yes — and it also protects your privacy. EXIF stores the camera model, settings and often the GPS coordinates of where the shot was taken. That data can be tens of kilobytes. Stripping metadata (jpegoptim --strip-all) shrinks the file and removes the geotag — handy before publishing.
For the web, almost always yes. At the same visual quality WebP is roughly 25–35% lighter than JPEG, and AVIF about 50%. Both are supported in every modern browser. JPEG stays the choice for maximum compatibility and where the format can't be changed — see the JPG → WebP converter.