Optimize
Compress Image to 100KB, 50KB or Any Size
Upload a JPG, PNG, or WebP and compress it by quality percentage or target file size. Before/after size comparison shown.
Written by Jay Sudha · Published · Last updated
How this tool handles files
- Processing
- In your browser, on-device
- Storage
- Nothing stored
- Output
- A file you download
- Your responsibility
- Review before official use
- Runs in your browser. Your file is processed on your own device and, on this site, is not uploaded to our servers.
- Nothing is stored. Your file and its output are gone the moment you close or reload the page.
- Review sensitive files (bank, ID, medical) and check the output before sharing it.
Every tool on FormatOS runs in your browser. Read our Privacy Policy and File Handling Policy.
From building this tool
A browser can't compress an image straight to a chosen file size, so to hit a target such as 100 KB this tool re-encodes the image up to 10 times at quality settings between 0.5 and 0.92, narrowing the range each time, and keeps the best version that fits. Below that range a full-size photo stops looking like the original, so if the target is still out of reach the tool reduces the pixel dimensions instead, at quality 0.8, and tells you the new size. PNG goes straight to that second step: it is lossless and the browser ignores the quality setting for it entirely. Either way the result says what it resized to, because a smaller picture handed back without a word is a surprise rather than a result.
Input formats
Output formats
Common uses
- Reduce image size for email attachments
- Optimize website images for faster loading
- Compress product photos for online stores
- Prepare images for form uploads with size limits
Limitations
- PNG is lossless: to make one smaller, convert it to JPG or WebP, or use a target size, which reduces its dimensions.
- A very small target may be met by reducing the image's dimensions; the result says so.
- Browser canvas compression may differ from server-side encoding.
Quality slider vs. target-size mode
This tool gives you two ways to shrink a file, and they suit different goals. Quality mode shows a slider from 5 to 95 (it opens at 82): you set a quality level and accept whatever file size results. For PNG output, which has no quality setting, a short note replaces the slider. It is the right choice when visual fidelity matters more than hitting an exact number, since you can nudge the slider and watch the before/after sizes on the result screen.
Target-size mode flips the priority. You pick a preset of 20 KB, 50 KB, 100 KB, 200 KB, 500 KB, or 1 MB, or type a custom value in KB, and the tool searches for the highest quality between 0.5 and 0.92 that still lands under that ceiling. This is built for hard limits, like a portal that rejects anything over 100 KB. If a full-size version cannot fit even at 0.5, the tool reduces the pixel dimensions instead and tells you the new size, since a smaller picture at decent quality looks far better than a full-size one crushed to fit. Only when even a small fraction of the original size cannot fit do you get a message instead of a file.
In both modes you can keep the input format or force the output to JPG, PNG, or WebP. Forcing WebP often beats JPG at the same quality, and forcing JPG is the practical way to make a large PNG actually shrink.
Why PNG behaves differently from JPG
PNG is a lossless format, so a PNG kept as PNG in quality mode is only rewritten, not reduced: it often comes out about the same size and can even be slightly larger, which the result screen shows. In target mode the tool shrinks a PNG by reducing its dimensions. If you need the same dimensions and a smaller file, change the format.
The fix is usually to change the output format. Set the output to JPG (or WebP) and a photographic PNG can drop dramatically in size, because those formats are allowed to throw away detail the eye rarely notices. The trade-off is transparency: JPG has no alpha channel, so a PNG with a transparent background will gain a solid background once converted. Keep PNG output for logos, line art, and anything that needs transparency; switch to JPG or WebP for photos.
Local processing, limits, and practical tips
Compression runs entirely in your browser using the Canvas API. Your image is decoded, re-encoded, and the result is handed back to you on the same page; on this site the file is not sent to a server. That means you can compress private screenshots, ID photos, or product shots without them leaving your device, and it also means speed depends on your own machine and the image's pixel dimensions.
The dropzone accepts JPG, PNG, and WebP up to 30 MB, and processes one image at a time. Because this is browser canvas encoding, the exact bytes can differ slightly from a server-side compressor or a desktop app; treat target sizes as close approximations rather than guarantees down to the last kilobyte.
For best results, start in quality mode around the default and only drop lower if the file is still too big. Pushing very low quality or a very small target can introduce visible blockiness and color banding, so check the preview before you rely on the output. If you also need fewer pixels, resize the image first, then compress, the two steps together cut size far more than either alone.
Frequently asked questions
Preset targets include 20 KB, 50 KB, 100 KB, 200 KB, 500 KB, and 1 MB. You can also set a custom target size.
Yes. Image compression runs locally using the browser Canvas API. On this site, files are not uploaded.
This tool compresses one image at a time. Upload an image, adjust the quality or target size, and download the result, then repeat for the next image.
Guide
- How to get a photo under a size limit
What a 12-megapixel photo looks like at 200, 100, 50 and 20 KB, measured, and the order that keeps portals happy.
Related tools
Tool last reviewed: September 27, 2026 · Report a problem