Image Compressor
Reduce image file size with a quality slider. Files never leave your browser.
Compress images without uploading
This tool compresses images entirely in your browser using the Canvas API — no files are uploaded to any server. Lower the quality slider to reduce file size; choose WebP for better compression with transparency support. JPEG quality around 75–85% is typically indistinguishable from the original. For a lossless format change, try JPG to PNG or Image to WebP.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Getting a photo under an upload size limit without an image editor.
- Trading quality against file size with the saving visible before you commit.
- Reducing page weight on an image-heavy page.
- Compressing a screenshot before attaching it to a ticket.
- Comparing two quality settings on the same source.
How it works in practice
A worked example
The tool's own sample image is loaded and compressed at the default settings, which turns out to be the most instructive thing it can do.
Load sample image → sample-image.svg, 451 B Quality 80% Output format JPEG → Compress
Original 451 B Compressed 10.6 KB Saved No savings
Twenty-four times larger, and the tool says so plainly rather than reporting a negative percentage. The sample is a vector: it stores a handful of shapes as instructions, and a few hundred bytes describe them completely. Compression here works by drawing the image onto a canvas and asking the browser to re-encode the pixels, which cannot compete with that — once the shapes have become a grid of colours there is nothing left of what made the original small. The wrong output format costs more than any quality setting saves.
The edge case that catches people
Two more behaviours follow from that canvas round trip and neither is announced. JPEG has no transparency, so the canvas is painted white before the image is drawn — a logo with a transparent background comes back on a white rectangle rather than a black one, which is the friendlier of the two wrong answers but still not what was there. And choosing PNG ignores the quality slider completely, because PNG is lossless: the slider stays where you left it and changes nothing at all about the result.
When not to use this tool
It re-encodes at the original pixel dimensions, so for the most common real problem — a four-thousand-pixel photograph going into a slot eight hundred pixels wide — resizing is where the saving is and this tool is not where you do it. The round trip also discards every piece of embedded metadata, which is a privacy win and a colour risk in the same step: an attached colour profile goes with it, so a wide-gamut photograph can come back visibly duller. For a build pipeline, an encoder that can see the whole set of images will beat one image at a time in a tab.
Frequently Asked Questions
- What does the quality slider actually control?
- The encoder's quantisation for JPEG and WebP — how aggressively it discards detail the eye is least likely to miss. It is passed straight to the browser's own encoder. PNG ignores it entirely, because PNG is lossless: the slider cannot make a PNG smaller.
- What quality should I pick?
- 80% is the usual sweet spot for photographs — visually indistinguishable from the original at typical viewing sizes while removing most of the bytes. Below 60% artefacts show around hard edges; above 90% the file grows quickly for gains almost nobody sees.
- Why did my PNG get bigger?
- Because a PNG of a photograph re-encoded through canvas can exceed the original — PNG's filters suit flat colour, not photographic noise, and the browser's encoder is not as clever as a dedicated optimiser. Convert photographs to JPEG or WebP instead.
- Does compressing twice compound the damage?
- Yes, for the lossy formats — every re-encode quantises again, so the artefacts of the first pass become the input to the second. Always compress from the original, never from a compressed copy, and keep the master file.
- Why is my EXIF gone?
- Canvas re-encoding drops all metadata, which usually means dropping the GPS coordinates and camera serial number too — a privacy gain. It also drops the orientation tag, so an image that relied on EXIF rotation may now appear sideways.
- Why does compressing a screenshot look worse than a photo?
- Because JPEG is built for smooth gradients and discards the sharp high-frequency edges that text and UI chrome are made of. Screenshots belong in PNG or WebP, where flat regions compress well and edges stay crisp.
Common errors and gotchas
- Compressing an already compressed image, which adds artefacts for very little further saving.
- Judging quality on a scaled-down preview rather than at display size.
- Compressing a screenshot or a diagram, where sharp edges pick up visible artefacts.
- Resizing and compressing in the wrong order, so detail is discarded twice.
- Overwriting the original, leaving no way back to a higher-quality source.