JPG (or JPEG) is the most widely used image format on the web, and for good reason — it's great at compressing photographs into small files. The catch is that most JPGs in the wild are still much larger than they need to be. A typical photo straight out of a phone camera can be 4 to 8 megabytes, when an indistinguishable version for the web is well under one. Here's how to compress JPG images the right way, without anyone seeing the difference.
What "without losing quality" really means
JPG is a lossy format, which means every time you save a JPG you discard a small amount of image data. The phrase "without losing quality" is therefore a slight stretch — what we really mean is without losing visible quality. The human visual system is far less sensitive to subtle colour shifts than to brightness changes, and JPG exploits this. Done well, you can throw away 70–80% of the file size before anyone can spot the difference on a screen.
How JPG compression works (briefly)
JPG splits the image into 8×8 pixel blocks, converts each block from the spatial domain into the frequency domain using the Discrete Cosine Transform, then quantises and discards high-frequency components your eye barely notices. The quality setting controls how aggressive that quantisation step is. Lower quality means more information thrown away, smaller file, and at some point visible artefacts.
The settings that actually matter
- Quality. Anything between 75 and 85 is the sweet spot for web use. 90+ is wasteful for most photos. Below 60 you start to see blocky artefacts in flat areas like sky or skin.
- Dimensions. A 6000-pixel-wide camera JPG on a 1920-wide layout is pure waste. Resize before — or as part of — compression.
- Chroma subsampling. "4:2:0" halves the colour resolution of each block (the eye barely notices) and typically saves another 20%. Most modern compressors use this by default.
- Progressive vs baseline. Progressive JPGs render gradually as they download — useful for slow connections — and often compress slightly smaller too.
How to do it: three quick paths
1. Use a browser-based compressor
The fastest option for a one-off file. Our free image compressor takes a JPG, targets around 1MB, caps the longest edge at 1920px and uses sensible defaults — all in your browser, with no upload. Drop the file in and you're done.
2. Use a desktop app
For local batch work, ImageOptim (Mac) or FileOptimizer (Windows) are free and excellent. They strip metadata and re-encode at sensible quality.
3. Use the command line
For developers, cjpeg from mozjpeg or cwebp for WebP gives you full control. A typical command is cjpeg -quality 80 -progressive in.jpg > out.jpg.
Mistakes to avoid
- Re-saving the same JPG repeatedly. Every save discards more data. If you'll need to edit the image again, keep the original (or work in PNG / TIFF) and export to JPG once at the end.
- Going below quality 60. Below this you start to see blocking. Resize the image smaller instead of cranking quality down.
- Skipping the resize step. A 4000×3000 JPG at quality 80 is still big. Resize to the dimensions you actually display at — that's the biggest win.
- Ignoring metadata. Camera EXIF, thumbnails and ICC profiles can add hundreds of kilobytes. Most online compressors strip these by default.
What about WebP?
WebP usually compresses 25–35% smaller than a comparable JPG at the same visible quality, and it's supported in every modern browser. If your platform allows it, WebP is the better default for photographs. If you need maximum compatibility (think email or older software), stick with JPG. We cover the trade-offs in detail in our JPG vs PNG vs WebP guide.
The short version
For 95% of cases, the right answer is: resize to no more than 1920px on the long edge, save as progressive JPG at quality 80, strip metadata. That alone usually shrinks a phone photo by 80–90% with no visible loss. Or just drop the file into our tool and let it do exactly that for you.