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.
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.
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.
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 used | Sensible width | Note |
|---|---|---|
| Avatar, icon | 200–400 px | Anything more is wasted |
| Image in a post / article | 1200–1600 px | With headroom for Retina screens |
| Full-width background / hero | 1920–2560 px | Beyond this the gain is tiny |
| Email / chat attachment | 1600–2048 px | Enough 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.
Upload your JPG
Drag the files into the converter window. Several at once is fine.
Pick format and quality
WebP at quality ~80 weighs less than JPEG for the same picture.
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 WebPIf 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.
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.
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.
| Format | Size at the same quality | When to use |
|---|---|---|
| JPEG | baseline (100%) | Maximum compatibility; format can't be changed |
| WebP | 25–35% lighter | The universal choice for the web today |
| AVIF | about 50% lighter | When 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:
Reduce the resolution
To the real display size (×2 for Retina). This gives −80–90% of the weight.
Set quality 75–80
Indistinguishable from 100 by eye, yet 2–3 times lighter.
Strip the metadata
--strip-all: minus the kilobytes and minus the geotag.
Enable progressive
Slightly lighter, and a nicer load on a slow connection.
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.
Frequently asked questions about compressing JPG
jpegoptim --strip-all) shrinks the file and removes the geotag — handy before publishing.Read next
BasicsWhat Is JPG: The Format That Holds the Internet Together
How lossy compression works and why JPEG is still everywhere.
TechWhy JPEG Loses Quality: Artifacts Under the Microscope
Where the "blocks" and halos come from, and how to avoid them.
ComparisonJPG, PNG or WebP for Photos: Which to Choose
Which format is lighter, sharper and more compatible — with real examples.