Image Compressor
Drop JPG, PNG or WebP images, set a quality or a target size in KB, and download smaller files — compressed on your device, never uploaded.
- Free
- No account
- Runs in your browser
- Nothing uploaded
Runs entirely in your browser — your input is never uploaded, logged, or stored.Privacy policy
What is Image Compressor?
This image compressor makes JPG, PNG and WebP files smaller without changing their pixel dimensions, entirely inside your browser. It is for anyone who has hit an upload limit, needs a lighter image for a website or email, or has to get a photo under a size such as 200 KB — and would rather not send private pictures to a server to do it.
JPG and WebP are compressed by re-encoding them at a lower quality with the browser's own encoder. Quality 75, the default, usually cuts a camera JPG substantially with little visible change; lower values shrink the file further and eventually show blocky artefacts. In "Target size (KB)" mode you type the size you need and the tool searches for the highest quality that fits: it tries quality 95 first, then halves the range each time, so it settles in at most 8 encodes instead of trying every value. For PNG the same search runs over palette sizes that are powers of two from 2 to 256 colours (at most 4 encodes). If even quality 1 is too big, it gives you that smallest version and says the target cannot be reached — resizing the image smaller is then the only way further.
PNG needs a different approach. PNG is lossless, and re-saving a PNG from a canvas usually makes it no smaller, often larger. What does work is reducing the number of colours. This tool builds a palette of at most 256 colours with the median-cut algorithm — repeatedly splitting the set of colours in the image where it is widest — and writes an indexed-colour PNG that stores one small palette index per pixel (1, 2, 4 or 8 bits) instead of four full bytes. Optional Floyd–Steinberg dithering spreads each pixel's rounding error to its neighbours so gradients do not band. Fully transparent areas stay exactly transparent. If an image already has 256 colours or fewer (a logo, a screenshot of flat UI), the palette is exact and nothing changes visually. Screenshots, charts and illustrations typically shrink a lot; photos saved as PNG shrink too but are usually better off as JPG.
Every result shows the size before and after and the percentage change. If the compressed version is not smaller than the original — which happens with files that were already well optimised — the tool keeps your original untouched, says so, and offers that for download instead of a worse file.
Metadata is removed as part of the process: EXIF camera data, GPS location, dates and embedded colour profiles are not written to a compressed file, and photos are saved upright. (An original kept because compression did not help is returned exactly as it was, metadata included.) That is often a privacy win, but it means a photo with a wide-gamut colour profile may look slightly different.
Everything happens locally, up to 50 files of 50 MB each per batch; PNGs larger than 40 megapixels are refused with a message, because reducing their colours would need several hundred MB of memory. Your images are decoded, compressed and offered back from the page's memory; you can confirm in your browser's developer tools (Network tab) that no request carries your files.
1. Each file's signature is checked: only real JPG, PNG and WebP files are accepted, whatever their names say. 2. The image is decoded by the browser (EXIF orientation applied) and drawn onto a canvas at its original size. 3. JPG/WebP, quality mode: the canvas is encoded at the chosen quality (default 75). 4. PNG, quality mode: the pixels are read; if there are no more distinct colours than the chosen palette size, that exact palette is used. Otherwise a 5-bit-per-channel RGBA histogram is built and median cut splits it into that many colours (one entry reserved for full transparency); each pixel is mapped to its nearest palette colour, with optional Floyd–Steinberg dithering (7/16, 3/16, 5/16, 1/16). 5. The indexed PNG is written by this page's own encoder: IHDR (colour type 3), PLTE, tRNS only if some colours are translucent, one IDAT compressed with the browser's zlib (CompressionStream "deflate") using filter type None as the PNG specification recommends for indexed images, and IEND. No metadata chunks are written. 6. Target-size mode: a binary search over quality 1–95 (JPG/WebP) or palette sizes 2, 4, 8, … 256 — powers of two — (PNG) keeps the highest setting whose output is at or under the target. 7. The output is compared with the original. If it is not smaller, the original is kept and you are told.
| JPG / WebP | PNG | |
|---|---|---|
| Method | Re-encode at lower quality | Reduce to a palette (≤ 256 colours), write indexed PNG |
| Lossy? | Yes | Yes, unless the image already had few enough colours |
| Transparency | WebP keeps it; JPG has none | Kept (fully transparent areas stay exact) |
| Setting | Quality 1–100 (default 75) | Number of colours (default 256), dithering on/off |
| Target size (KB) | Searches quality 1–95 | Searches powers of two from 2 to 256 colours |
Worked examples
- A 64 × 64 gradient with 4,096 distinct colours reduced to 16 colours → an indexed PNG with at most 16 palette entries at 4 bits per pixel.
- A 3 × 2 image with 4 colours — one fully transparent, one half-transparent (alpha 128) and two opaque → stored exactly (lossless) as a 2-bit indexed PNG whose tRNS table has 2 entries, one for each non-opaque colour.
- A 2,000,000-byte file compressed to 600,000 bytes → shown as 1.91 MB → 585.9 KB (-70%).
- A 100,000-byte file that re-encodes to 104,000 bytes → the original is kept, with the message that compressing made it larger (+4%).
- Target size: the search finds the highest quality at or under the target in at most 8 encodes (4 for PNG); if quality 1 is still too big, the smallest version is returned and marked as over the target.
How to use Image Compressor
- Click "Choose JPG, PNG or WebP images", drop files onto the box, or paste with Ctrl+V (Cmd+V on a Mac).
- Under "Compress by", keep "Quality" and set the JPG/WebP quality and PNG colours — or choose "Target size (KB)" and type the size you need.
- Click "Compress images" and check the before, after and change figures.
- Download each file, or click "Download all (.zip)".
Common errors
- "… is already … at or under the … target — there is nothing to compress." — the file is already smaller than the size you typed. Choose a smaller target.
- "… cannot get under … even at the lowest quality" — the image has too many pixels for that size at any quality. Resize it smaller first, then compress.
- "Compressing made it …, not smaller — your original … file is kept unchanged" — the file was already well optimised; download the original (its metadata is still in it).
- "… is actually a GIF file, not JPG, PNG or WebP." — only JPG, PNG and WebP are compressed here; convert other formats first.
- "PNGs over 40 megapixels are not compressed here" — the image is too large to reduce colours safely in a browser tab. Resize it smaller first with the image resizer.
- Colour banding in a PNG — too few colours for a smooth gradient. Choose more colours or turn on PNG dithering.
FAQ
How do I compress an image without uploading it?
Drop it onto this page and click "Compress images". The compression runs in your browser, so the file never leaves your device, and you can verify that in the Network tab of your browser's developer tools.
How do I reduce an image to a specific size in KB?
Choose "Target size (KB)" under "Compress by", type the size, for example 200, and click "Compress images". The tool finds the highest quality that fits under that size; if even the lowest quality is too big, it tells you and gives you the smallest version.
How do I compress a PNG?
Drop the PNG here and click "Compress images". PNG cannot be compressed by lowering a quality setting, so the tool reduces it to a palette of up to 256 colours and saves an indexed PNG, which is usually much smaller for screenshots, logos and illustrations.
How do I compress a JPEG without losing quality?
Re-compressing a JPG always loses a little information, but at quality 75–85 the change is usually hard to see while the file gets much smaller. Keep the quality high if the image will be edited again later.
Why did my file not get smaller?
Some files are already compressed as tightly as the browser's encoder can manage. When the result is not smaller, the tool keeps and offers your original rather than a larger copy, and says so.
Does compressing remove EXIF and location data?
Yes. The compressed file does not include EXIF metadata such as camera model, date or GPS location, and embedded colour profiles are dropped. Photos are rotated upright first so they still display correctly.
Is it safe to compress private photos here?
Yes. The images are processed in your browser's memory on your own device and are not uploaded, stored or logged by this site.
How many images can I compress at once?
Up to 50 images per batch, each up to 50 MB. You can download them individually or together as a ZIP file.
Related tools
- Image ResizerDrop images, choose a percentage, a width, a height or an exact pixel size, and download the resized copies — all processed on your device.
- WebP to JPG ConverterDrop WebP images, pick a quality and a background colour for transparent areas, and download them as JPG — converted on your device, never uploaded.
- HEIC to JPG ConverterDrop iPhone HEIC photos, choose JPG or PNG, and download converted images — decoded on your own device, never uploaded, no watermark.
- PNG to JPG ConverterDrop PNG images, choose a JPG quality and a colour for transparent areas, and download smaller JPG files — converted on your device, nothing uploaded.
- Compress PDFChoose a PDF, pick lossless clean-up or strong compression, and see the exact before and after size — compressed on your device, never uploaded.
Prefer AllUtil on Google
One click adds AllUtil to your Google preferences. You'll see our tools highlighted with a Preferred badge in Search and AI answers.