Image Compressor
Compress JPG, PNG and WebP images in bulk — set a quality level or a target size in KB, resize, and convert formats. Runs on your device; nothing is uploaded.
- Free — No signup required
- Instant — Results update as you type
- Private — Processed in your browser
Most images are far larger than they need to be: phone photos are shot at 12 megapixels with 95% JPEG quality, screenshots are saved as PNG when they contain a photo, and exports from design tools ignore file size entirely. This compressor decodes each image in your browser, optionally shrinks it, and re-encodes it at a quality or a file size you choose.
How it works
Drop up to 20 JPG, PNG or WebP files. Each is decoded with createImageBitmap, which also applies the EXIF orientation flag so portrait phone photos come out the right way up. If you set a maximum dimension, the image is downscaled in successive halvings rather than one jump, which avoids the aliasing a single large resample produces. It is then drawn onto a canvas and encoded with the browser's own encoder. Where the browser supports it, this runs in a Web Worker with an OffscreenCanvas, so the page stays responsive while a batch of large photos is processed one after another.
Two modes control the encoder:
- By quality passes your slider value (10–100%, default 80%) to the JPEG or WebP encoder.
- By target size takes a limit in KB and bisects the quality range between 5% and 95%, up to eight encodes, keeping the highest quality whose output fits. If even 5% does not fit, the smallest result is returned and the miss is reported; reduce the dimensions and try again.
The output format defaults to the source format. Choosing JPEG for a transparent PNG or WebP flattens transparency onto white, since JPEG has no alpha channel. PNG is lossless, so neither mode changes it; a re-saved PNG is smaller only if the original carried metadata or was poorly compressed. WebP is the choice for a much smaller PNG with transparency intact.
When re-encoding in the same format produces a larger file, which happens with already-optimised JPEGs, the original is kept and reported as such. A deliberate format change is always honoured. Files download as name-compressed.jpg, .png or .webp, individually or all at once.
Because pixels are decoded and re-encoded, all metadata is dropped: EXIF (including GPS position and camera details), colour profiles and comments. Images are converted to sRGB in the process, which is what the web expects. SVG is not accepted; rasterising a vector file is a conversion, not a compression.
Getting small files that still look good
Dimensions matter more than quality. A 4000-pixel-wide photo at 60% quality is bigger than a 1600-pixel version at 85%, and the smaller one looks sharper on any screen narrower than 1600 pixels. Pick the largest size at which the image will actually be displayed, then set quality.
For photographs, JPEG or WebP at 75–85% is visually indistinguishable from the original for most viewers; below 60% blocking becomes visible in gradients and skies. Screenshots, diagrams and text should stay PNG or go to WebP; JPEG smears sharp edges.
Target-size mode is for hard limits: a 100 KB avatar upload, a 2 MB email attachment, a 500 KB page-weight budget. Set the limit and let the search find the quality rather than guessing.
A browser that cannot encode a requested format silently returns PNG data instead. If a WebP result is unexpectedly large, that is the likely cause; try another browser.
Command-line equivalent
ImageMagick and the WebP tools do the same job in bulk:
convert photo.jpg -auto-orient -resize '1920x1920>' -strip -quality 80 photo-compressed.jpg
cwebp -q 80 -resize 1600 0 logo.png -o logo.webp
Learn more
The Canvas API and <img> attributes that let a page serve the right image size to each device are covered in HTML5 essentials; shell basics shows how to loop the commands above over a directory. To change dimensions without touching quality, use the image resizer, and to bundle the results into a document, the image to PDF converter embeds JPEGs without re-encoding them.
FAQ
- Are my images uploaded anywhere?
- No. Compression runs locally in your browser using the Canvas API — your images are never sent to a server, and the tool works offline once the page has loaded.
- How do I compress an image to a specific size like 100 KB?
- Switch to "By target size" and enter the limit in kilobytes. The tool encodes the image at several quality levels and keeps the highest one that still fits under your limit. If nothing fits, reduce the dimensions with the resize option — a smaller image needs far fewer bytes to look sharp.
- Why doesn't the quality slider change my PNG?
- PNG is a lossless format, so its encoder has no quality setting to adjust — re-saving a PNG only strips metadata. To make a PNG substantially smaller, change the output format to WebP, which is lossy but still supports transparency.
- Can I compress several images at once?
- Yes. Drop in up to 20 images at a time; they're compressed one after another with the same settings, and you can download them individually or all at once.
- Is EXIF data removed from compressed images?
- Yes. The image is decoded to raw pixels and re-encoded, which discards EXIF metadata such as GPS coordinates and camera model. Rotation recorded in EXIF is applied to the pixels first, so the image keeps its correct orientation.