How to compress images without losing quality
Most images can lose two thirds of their weight before anyone can tell. Here is where the line sits.

The phrase "without losing quality" is technically impossible: every compression step throws something away. What is very possible is losing quality nobody can see, which is what everyone actually means and what modern encoders are extremely good at.
The gap between a 4 MB photo and a 300 KB version of the same photo is almost entirely invisible on a screen. Getting there reliably is a matter of doing three things in the right order and knowing which setting to stop at.
What you need to know first
Before the step-by-step, these are the points that decide the outcome. If you are in a hurry, the first one covers most cases.
Resize first, compress second
A 6000 px photo displayed in a 900 px column is carrying 40 times more pixels than it needs. Scaling down before compressing does the heavy lifting; compression only tidies up afterwards.
Quality 80 is the sweet spot
Between 75 and 85 the file drops dramatically while the image stays clean. Above 90 you pay double the bytes for a difference nobody detects. Below 70 flat areas start to block up.
Judge at 100%, not in a grid
Compression damage is invisible at thumbnail size and obvious full screen. Always check the actual pixels before you commit a batch, especially in skies, walls and skin.
Keep the original, always
Compression is one-way. Export a compressed copy into a separate folder and leave the master alone, so a bad setting is a redo rather than a loss.
Where the weight comes from
An image’s file size is driven by three things, and most people only ever adjust the third.
| Factor | Typical impact | What to do about it |
|---|---|---|
| Pixel dimensions | Enormous — halving the width cuts size ~75% | Resize to display size before anything else |
| Format | Large — WebP is ~30% under JPG | Match the format to the destination |
| Quality setting | Moderate — quality 100 to 80 cuts ~60% | Export at 80, check, adjust |
| Metadata | Small — usually 20–100 KB | Strip on export unless you need it |
That first row is why so much compression advice disappoints. Dragging a quality slider on a 6000-pixel photo is polishing the wrong thing. Scale it to 1200 pixels first and the file is already a tenth of the size before compression touches it.
The four-step method
Step 1: Decide the display size
Measure how wide the image will actually appear. On most websites, the content column is 700–900 pixels. On a full-width banner it might be 1920. Whatever the number, double it for high-density screens and stop there. A 1600 px image in an 800 px slot is already as sharp as any display can show.
Step 2: Resize to that number
Scale down, never up. Use your operating system’s built-in resizer, Squoosh, or the export dialog of whatever made the image. Keep the aspect ratio locked so nothing stretches. This one step usually saves more than any quality setting.
Step 3: Export at quality 80
Set the quality slider to 80 and export. In Squoosh this is the number in the right-hand panel, and in Photoshop’s Export As it is the Quality field. Phone apps often use a high, medium or low picker instead. Watch the projected file size update as you move it.
Step 4: Inspect before you commit
View the result at 100% zoom and compare it against the original side by side. Look at three places specifically: large flat areas for blocking, sharp edges for halos, and any text for smearing. If it looks clean, you are finished. If not, raise the quality by five and re-export. Do not edit the compressed file.
Never compress over the top of your originals. A batch tool pointed at your photo library with “overwrite” ticked will happily destroy a decade of images in thirty seconds, and there is no undo. Always output to a new folder, check a few files, and only then delete anything.
Tools worth using
Squoosh (squoosh.app) is the best single-file tool there is. It runs entirely in your browser, nothing uploads, and the split-screen preview with live file sizes makes the quality decision obvious rather than a guess. It handles JPG, PNG, WebP and AVIF.
Your operating system handles batches without any download. Windows PowerToys adds an Image Resizer to the right-click menu that processes a whole folder. macOS Preview can open dozens of files, select all, and resize them in one action; the Finder’s Quick Actions do format conversion the same way.
Command-line tools are worth ten minutes of setup if you do this weekly. ImageMagick and cwebp will process thousands of files with one line and exactly repeatable settings. They are also the only realistic option once a folder passes a few hundred images.
Whichever you use, the settings matter more than the brand. A famous paid tool at quality 95 produces a bigger, worse-value file than a free one at quality 80.
What quality setting to use for what
| Image type | Format | Quality | Notes |
|---|---|---|---|
| Photograph on a website | WebP | 80 | The default that works for almost everything |
| Photograph for email or upload | JPG | 80 | Universal compatibility |
| Screenshot with text | PNG | Lossless | Lossy makes letters fuzzy |
| Logo with transparency | PNG or WebP | Lossless | Never JPG |
| Large hero banner | WebP | 75 | Viewed briefly, at distance |
| Thumbnail under 400 px | WebP | 70 | Damage is invisible this small |
| Print-bound artwork | TIFF or PNG | Lossless | Compress nothing; the printer needs the data |
Two mistakes that cost the most
Compressing something that was already compressed. A JPG downloaded from a website has already been through an encoder. Running it through another one re-analyses the artefacts as if they were real detail, so you pay in quality twice. If you can possibly get the original, get the original.
Leaving metadata in by accident. Camera files carry EXIF data: model, settings, often GPS coordinates. On a 40 KB thumbnail, 80 KB of metadata is the majority of the file, and the location data is a privacy problem on top. Most export tools have a “strip metadata” checkbox; tick it unless you specifically need copyright fields preserved.
In short
Resize, then compress, then check at full size. Do those three in that order and a 4 MB photo becomes a 180 KB file that nobody can tell apart from the original.
If you need to hit a specific number rather than just “smaller”, the technique is slightly different. See how to reduce an image to an exact file size. For the resizing half of the job, resizing without distortion covers the arithmetic, and batch resizing for free handles the case where you have four hundred of them.
Frequently asked questions
How small should a website image be?
As a working rule: hero banners under 300 KB, in-article images under 150 KB, thumbnails under 40 KB. A whole page ideally lands under 1 MB of images. If you are over, the problem is almost always pixel dimensions rather than the quality setting.
Does compressing an image twice make it worse?
Yes, with lossy formats. Each JPG or lossy WebP save re-analyses an already-damaged image and throws more away, and the artefacts compound. Never edit an exported JPG and re-save it; go back to the original, make the change there, and export again.
Is lossless compression worth using?
For photographs, rarely. Lossless typically saves 10–20% where lossy saves 70%. For screenshots, logos and flat graphics it is the right choice, because lossy compression makes hard edges fuzzy. PNG and lossless WebP both do it well.
Do online compressors steal your images?
Reputable ones do not, but your file does leave your device and sits on a third-party server for a while. For anything private (documents, ID photos, unreleased product shots), use a tool that runs locally in your browser such as Squoosh, or the export function built into your operating system.


