How it works
This tool decodes your image and uses the browser’s Canvas API to create a new file. It uses binary search to find the highest quality that fits your target, then reduces dimensions only when necessary. The original file is never sent to a server.
- JPEG and WebP are best for photographs and support quality adjustment.
- PNG keeps transparency and sharp edges; its size is controlled by dimensions rather than a quality slider.
- Actual output can vary by browser encoder and image content. A target is a guide, not a promise to enlarge a file that is already smaller.
Under the hood
Compression happens on a canvas. The image is decoded by the browser, drawn at a chosen scale and encoded with toBlob(), then the tool runs a binary search on the encoder quality between 0.05 and 1 to find the highest value whose output still fits your target size — so an 800 KB photograph can be pushed under 200 KB at the best quality that allows it, rather than at an arbitrary setting. If no quality fits, it reduces the pixel dimensions step by step and repeats the search, and PNG input takes a separate path that simply re-encodes the canvas because PNG has no quality dial. The result is shown with its dimensions and byte size next to the original so you can compare before downloading. Nothing is uploaded: the file is read with the browser's decoder and written back as a new Blob.
Formats, sizes and other limits
Inputs are capped at 30 MB per file, and the target size is clamped between 1 KB and 50 MB, with a maximum dimension that cannot drop below 64 pixels or exceed 12,000. Re-encoding is lossy and destructive: the new file carries no EXIF orientation tag, no colour profile and no metadata from the original, and JPEG output flattens transparency onto white while PNG keeps it. Because the browser decodes and redraws the image, animated GIF or animated WebP input is reduced to a single frame. CMYK JPEGs are converted to RGB by the canvas, which shifts colours slightly, and hitting an aggressive target on a very detailed photo can produce visible blocking. One image is processed per run.
Privacy: nothing is uploaded
The chosen photograph is decoded and re-encoded inside this tab; because the new file is created by the canvas in your own browser, no copy of the original or the result ever leaves your device. The page has no upload path, no queue and no server side at all.
Frequently asked questions
How does the target file size work?
Give it a number of kilobytes and the encoder tries qualities between 5% and 100%, keeping the highest that still fits. If even the lowest quality is too big, the tool shrinks the pixel dimensions and searches again, so you get the best-looking file that meets your limit.
Why is my PNG the same size after compressing?
PNG is lossless, so there is no quality setting to trade away; the tool can only re-encode the canvas. Resize the dimensions, or export as JPEG or WebP, if you need a smaller file from a PNG source.
Does compressing remove the photo's metadata?
Yes. The output is a brand-new raster image, so EXIF fields such as camera model, capture time and GPS position are gone, along with any colour profile. Keep the original if you need that information, or use the metadata cleaner when removing it is the goal.