How to compress a JPEG for the web
Updated
To compress a JPEG for the web, size it to the pixel dimensions it's actually displayed at, then export at a quality of about 75–82 — usually indistinguishable on screen while cutting file size dramatically. Do it in the EditItAll JPG compressor, which runs in your browser, nothing uploaded.
Do it now — free, in your browser
Compress JPEGWhy oversized JPEGs slow pages down
A single oversized JPEG can weigh more than the rest of a web page combined, and it's the most common reason a page feels slow. The camera or export that produced it optimised for a print or a full-screen photo — not for a thumbnail, a hero banner, or a product grid, where the same file is often several times heavier than it needs to be.
The upside: JPEG is a lossy photographic format, so it can shed a lot of data your eye won't miss. Compressing sensibly — and sizing the image to how it's actually shown — routinely cuts a photo to a fraction of its original weight with no visible difference on screen.
Compress a JPEG for the web, step by step
The JPG compressor gives you a quality control you can nudge until the size and the look are both right:
- Open the JPEG compressor and drop your photo in — you can load several at once.
- Set the quality. For photos on the web, somewhere around 75–82 is the sweet spot: visually indistinguishable on a screen while cutting the file size dramatically.
- Preview, then export and download. The exported copy is a fresh JPEG with the metadata stripped, so hidden EXIF and GPS data don't ride along to your server.
Everything runs on your device — you can go offline after the page loads and it still works, which is the plainest proof your images aren't being uploaded anywhere.
Match the image to the space it fills
Quality is only half the win — dimensions are the other half. Shipping a 4000-pixel-wide photo into a slot that only ever displays it at 800 pixels wastes most of the file on detail no visitor will ever see, and the browser still has to download every one of those extra pixels.
So before you compress, resize the image to roughly the largest size it's actually shown at (a little extra for high-density screens is fine). A photo sized to its display box and then compressed at quality 75–82 is often a tenth of the original — usually the single biggest speed win you can make. One caution: JPEG compression is one-way and it stacks. Re-compressing an already-compressed JPEG adds visible artefacts each time, so always start from the original and compress once.
When to reach for WebP or AVIF
JPEG is the safe, universal choice, but it's no longer the smallest. Its modern successors — WebP and AVIF — reach the same visible quality at a noticeably smaller size, and both are well supported across current browsers. If page weight is your priority, it's worth converting a JPG to WebP or to AVIF and comparing the result.
It's an honest "consider it", not a rule: if you need a file that opens absolutely everywhere with zero fuss, stick with JPEG. For a wider look at picking a quality level and a format, see how to compress images without losing quality.
Frequently asked questions
What quality should I use to compress a JPEG for the web?+
For most web photos, a quality of about 75–82 is the sweet spot — small enough to load fast, high enough that the loss is invisible on screen. Go lower only for tiny thumbnails, where a little softening won't be noticed.
What matters more, quality or image dimensions?+
Dimensions usually matter more. A 4000-pixel photo squeezed into an 800-pixel slot is mostly wasted weight. Resize the image to the size it's actually displayed at first, then compress — together they give the biggest speed win.
Should I use WebP or AVIF instead of JPEG?+
If page weight is the priority, yes — WebP and AVIF hit the same visible quality at a smaller size and are well supported. If you need a file that opens everywhere with no surprises, JPEG is still the safest choice.
Are my images uploaded to compress them?+
No. The compressor runs entirely in your browser, so your JPEGs never leave your device. You can disconnect from the internet after the page loads and it still works, and EXIF metadata is stripped on export.
Why does my JPEG look worse each time I save it?+
JPEG is lossy, and re-compressing an already-compressed file adds artefacts every time. Keep the original and compress from that once, rather than re-saving a copy that has already been through JPEG.