Image Compressor
Compress images online for free without losing quality. Optimize PNG, JPG, JPEG, and WebP files.
Drag & Drop image here
or click to select file
Supports PNG, JPG, WebP
About Image Compressor
Compressing an image here means re-encoding it. The file you drop is decoded by the browser, redrawn onto a canvas, and written back out in the same format at a lower quality target. A JPEG comes back as a JPEG, a PNG as a PNG, a WebP as a WebP, so nothing that reads the file afterwards has to change.
Three things shrink the file
The slider sets the encoder quality between 10% and 100%, starting at 80%. Independently of that, the longest side is capped at 1920 pixels. A 3000 x 2000 photo therefore comes back at 1920 x 1280 even with quality at 100%, and on a large phone photo that resize is usually where most of the saving comes from. 1920 px is still wider than the screen most people will view it on. If you need the original pixel dimensions kept, the Bulk Image Compressor is configured to preserve resolution instead.
The third is a size target. The tool aims for a result under 2 MB that is also no larger than the file you started with. If a single pass misses that, it re-encodes in a loop, dropping the quality a little each time and — only when the 2 MB target is the one being missed — shrinking the canvas by a further 5% per pass, up to ten passes. So a very large photo can come back below 1920 px on its longest side. That is the target being enforced, not a bug.
The slider works on PNG too, though not in the way you might expect. PNG has no JPEG-style quality knob, so the encoder used here converts the slider into a colour count and quantises the image to that many colours before writing the file — roughly 4,000 colours at 100%, around 400 at 10%. That makes PNG output here lossy rather than lossless, and it is why a flat graphic can shrink dramatically while a photograph saved as PNG picks up visible banding at low settings. If your PNG is a photograph rather than a screenshot, logo or diagram, converting it to JPEG or WebP with the Image Converter is still the better move.
What happens to your file
Your picture never leaves the machine you are sitting at. It is read with the browser File API into an in-memory blob, encoded on your own CPU, and discarded — along with the compressed copy — when you close the tab. There is no upload step and no server to store anything. The encoding runs in a Web Worker so the page stays responsive, and that worker’s script is served from this site rather than a third-party CDN, so pressing compress produces no cross-origin request at all. If that one script cannot be loaded the tool falls back to compressing on the main thread, so it still works offline — just without the worker.
The limit is what your browser can decode. JPEG, PNG and WebP go in and come back out in the same format, and BMP has its own writer here so it survives too. A GIF decodes, but a canvas only ever holds one frame and no browser can write GIF back, so the animation does not survive — reach for the Image Converter if you need to choose the output format explicitly. HEIC and HEIF straight from an iPhone cannot be decoded at all and give you an error rather than a silent failure; run those through the HEIC to JPG tool first. An SVG has nothing to re-encode in the first place, since it is vector markup rather than a grid of pixels.
Quality slider you can see
Every move of the slider re-encodes the picture and updates the byte count beside the preview, so you can stop at the point where the image starts to look wrong instead of guessing a number.
Side-by-side comparison
Original and result are shown at the same display size with their exact file sizes, which is the only reliable way to judge whether the saving cost you anything visible.
Format is never switched
A JPEG downloads as a JPEG and a PNG as a PNG, keeping the original filename behind a compressed- prefix. Nothing downstream has to be told the file changed.
Encoded on your own device
Your picture is never uploaded — it is decoded and re-encoded by a Web Worker on your own CPU. The only network request involved is the one that loads that worker’s script, and it comes from this site rather than a third-party CDN; if it fails the tool simply compresses on the main thread instead.
Frequently Asked Questions
Why is my downloaded image smaller in pixels than the original?
The tool caps the longest side at 1920 pixels, so a 3000 x 2000 photo comes back as 1920 x 1280. That resize is deliberate: it is the single biggest saving available on a modern phone photo, and 1920 px is wider than most screens the image will be viewed on. It can go smaller still — if the result is over the 2 MB target the tool re-encodes in a loop and takes another 5% off each side per pass. If you need the original dimensions kept, use the Bulk Image Compressor, which preserves resolution, or the Image Resizer if you want to choose the numbers yourself.
Does the quality slider do anything to a PNG?
Yes, but not in the JPEG sense. PNG has no quality parameter, so the encoder here turns the slider into a colour count and quantises the image before writing it — roughly 4,000 colours at 100% and around 400 at 10%. PNG output from this tool is therefore lossy: a logo or screenshot can shrink a lot with no visible change, while a photograph saved as PNG will start to show banding as you drag the slider down. If the PNG is really a photograph, convert it to JPEG or WebP with the Image Converter instead.
Is my photo uploaded anywhere?
No. Your photo is read into memory by your browser, encoded on your own CPU, and handed straight back as a download. Being precise about the Network tab: the compression library runs in a Web Worker, so the first time you compress you will see one request for a JavaScript file — that worker's script, served from this site, containing code and none of your image. It used to come from a public CDN; it no longer does, so nothing cross-origin happens when you compress. Block it or go offline and the tool falls back to compressing on the main thread.
Which file types actually work?
Anything your browser can decode. JPEG, PNG, WebP and BMP round-trip in the same format. A GIF decodes but loses its animation, because a canvas holds one frame and browsers cannot write GIF. HEIC and HEIF photos straight off an iPhone cannot be decoded and will show an error instead of failing silently — run those through the HEIC to JPG tool first, then compress the JPEG. An SVG is vector markup with no pixel grid to re-encode.
Can I undo the compression later?
Not for JPEG or WebP — the discarded detail is gone for good. Keep your originals somewhere safe. It also means you should always compress from the original rather than re-compressing a file that has already been through the tool, because each pass throws away more.
How much smaller will my file get?
It depends entirely on what is in the picture. Photographs with fine detail and noise compress heavily, often by 70-90%. Flat graphics, screenshots and text compress badly as JPEG and can even grow, because the encoder spends bits trying to reproduce hard edges. Content like that belongs in PNG or WebP.
How do I compress a whole folder at once?
Use the Bulk Image Compressor. It takes a multi-file selection, shows the before and after size for each image, and gives you everything back as a single ZIP. It also keeps every image at its original resolution, which this single-file tool does not.
Does compressing strip GPS and camera data?
Re-encoding through a canvas does drop the metadata blocks, but do not treat that as a privacy guarantee — it is a side effect, not the purpose. If your goal is to remove location data before sharing a photo, use Remove Image Metadata, which is built for it and can clean a JPEG without re-encoding the pixels at all.
Why did my file get larger instead of smaller?
It usually will not, because the tool notices and retries: if the first pass comes back bigger than the original it re-encodes at a lower quality, up to ten times, before giving up. When it still ends up larger, the source was already compressed harder than anything the encoder can match — re-encoding at 90% a JPEG that was saved at 60% adds bytes without adding detail. Drag the slider down until the result is genuinely smaller, or keep the file you already had.