Image Compressor: Compress JPEG, PNG & WebP to a Target File Size
Set a quality level, or name an exact size like 100 KB or 1 MB and let the tool hit it β all in your browser, no upload needed.
Every image is re-encoded at this quality. File sizes will vary by image.
Drop an image here or browse files
JPEG Β· PNG Β· WebP Β· GIF β max 30 MB each
How to Compress Images Online β Free & Private
You drop in JPEG, PNG, WebP, or GIF files, choose either a quality level or a target file size, pick an output format, and this tool re-encodes each image right in your browser using the HTML5 Canvas API. No image is ever uploaded to a server; the whole process runs locally on your device, from decoding the original file to writing the compressed bytes you download.
Two ways to compress
Quality mode draws each source image onto a canvas at its original resolution, then asks the browser to re-encode that canvas at the quality percentage you set. Lower quality means more aggressive compression and a smaller file, at the cost of subtle detail in shadows, gradients, and fine textures. Because the slider and format toggle apply to every image already in your list, you can drop in a batch, try 80 percent, glance at the before-and-after sizes, and nudge the slider until the savings look right. What you cannot do is predict the resulting file size β the same quality setting turns a simple graphic into a few kilobytes and a detailed photo into several megabytes.
Target file size mode inverts that. You name the size you need β 20 KB, 100 KB, 1 MB, whatever the upload limit in front of you demands β and the tool works out the quality setting for you, per image. It does this by binary searching the quality range: encode at the midpoint, check the resulting byte count, then narrow the range up or down and repeat. Around seven encodes are enough to land on the highest quality that still fits, which is far faster than stepping through every value one at a time.
Sometimes quality alone cannot get there. A 12-megapixel photo squeezed toward 20 KB runs out of room long before the quality floor, because there are simply too many pixels to describe in that many bytes. When that happens the tool starts reducing the image dimensions in steps and searching again at each one, since pixel count is the only lever left. The result line tells you what it settled on β the final quality, and the resize percentage if one was needed. If even the smallest step overshoots, you still get the smallest file the tool could produce, clearly marked so you know the target was not met rather than being handed a file that quietly misses it. When you care about the dimensions themselves rather than the byte count, the Image Resizer lets you name an exact width and height instead of leaving it to the search.
Because each image is searched independently, a batch with a wide range of sizes still comes out uniformly under your limit. Ten photos targeted at 500 KB each land at 500 KB each, whatever they started at. Use the Single Image tab when you want to see one photo before and after, and the Batch tab when you have a folder to get through.
Every image in the list tracks its own status independently, so a large batch doesn't block on a single slow file. Once an image finishes, you see its original size, its new size, and the percentage saved right next to it, plus a running total across every image you've added so far.
JPEG vs WebP
- π·JPEG gives you maximum compatibility. Every app, browser, printer, and social platform built in the last two decades opens it without a second thought.
- πWebP produces files 25 to 35 percent smaller than JPEG at equal visual quality, which is why most modern websites use it for product photos and hero images. Support is nearly universal in current browsers, though a handful of older tools and some desktop software still expect JPEG or PNG.
Common use cases
- β‘Speeding up a website. Oversized images are the single most common cause of slow page loads, and shaving a 4 MB photo down to 400 KB often does more for load time than any other change you can make.
- π§Getting attachments under an email provider's size limit without resizing the image itself.
- π±Preparing photos for social platforms that silently re-compress large uploads and often produce worse results than compressing them yourself first.
- πΎFreeing up storage on a phone or cloud drive when a folder of photos is eating through your quota.
Tips for the best results
- ποΈStart at 80 percent quality and adjust from there. It's the sweet spot for most photos: real file size reduction with almost no visible loss on a typical screen.
- π―Use target file size mode whenever something else sets the limit for you β a form that rejects anything over 2 MB, an email cap, a marketplace listing that wants photos under 500 KB. Aim slightly under the stated limit, since some systems count encoding overhead differently.
- πIf a target forces a large resize, the limit is pixel count rather than compression. Consider whether a smaller target is genuinely required, or switch to WebP, which reaches the same size at higher quality.
- πZoom in on the compressed thumbnail before committing to a low quality setting. Artifacts show up first around text, sharp edges, and areas of flat color like skies.
- πAvoid compressing the same JPEG repeatedly across multiple tools. Each re-encode throws away more data, so always start from the highest-quality original you have.
Related tools
Need exact pixel dimensions instead of an exact file size? The Image Resizer takes a width and height directly. Need to change format rather than just compress? The Image Converter handles JPEG, PNG, and WebP in either direction. For iPhone HEIC photos, the HEIC Converter converts to JPEG or PNG first. To enlarge a small image, the Image Upscaler scales up 2 to 4 times using Lanczos resampling.
Frequently asked
Is my data private? Compression runs entirely in your browser through the HTML5 Canvas API. Your images never leave your device at any point in the process.
What quality setting should I use? 75 to 85 percent works well for most web images. Below 60 percent you'll start noticing visible artifacts. For email attachments where file size matters more than fidelity, 60 to 70 percent is usually fine.
Can I compress PNG files? You can. This tool converts them to JPEG or WebP during compression, which typically achieves a 60 to 80 percent size reduction. Note that PNG transparency becomes a solid white background in JPEG output, since JPEG has no alpha channel.
Can I compress an image to an exact file size? Yes. Switch to target file size mode, type the size you need, and pick KB or MB. Each image is searched independently for the highest quality that still fits under your limit, so output lands at or just below the target, never above it.
Why didn't my file get smaller? An already-compressed JPEG at high quality may not shrink much further, because most of the redundant data is already gone. Try lowering the quality slider or switching to WebP for a fresh gain.
Why smaller images matter
Page weight from images affects more than load time on a slow connection. Search engines factor page speed into ranking, mobile visitors on limited data plans pay for every megabyte a page downloads, and a slow-loading gallery or product page loses visitors before the images even finish rendering. Compressing images before you publish them, rather than relying on a hosting platform to do it automatically, gives you control over exactly how much quality you're trading for file size. A batch of ten product photos going from 3 MB each down to 300 KB each is the difference between a page that loads in two seconds and one that takes twenty on a phone with a weak signal.
Frequently Asked Questions
Is the Image Compressor free?
Yes β completely free. No account, no subscription, and no watermarks on compressed images.
Are my images uploaded to a server?
No. Compression runs entirely in your browser using the HTML5 Canvas API. Your images never leave your device.
Do I need an account?
No account, no login, and no signup required.
What image formats are supported?
JPEG, PNG, WebP, and GIF as input. Output is JPEG or WebP.
Will compression make my image look worse?
At quality 80β85%, loss is nearly invisible on typical screens. Use the side-by-side preview to find the lowest quality setting where you cannot see a difference.
Can I compress multiple images at once?
Yes. Drag and drop multiple images and download them individually or all at once.
Can I compress an image to a specific file size like 100KB or 1MB?
Yes. Switch to the Target File Size tab, enter the size you need, and choose KB or MB. The tool binary-searches the quality range for each image to find the highest quality that still fits under your limit, and reduces the dimensions automatically if quality alone cannot reach the target.
What happens if the target size is too small to reach?
You still get the smallest file the tool could produce, clearly labelled so you know the target was not met. This usually means the image has too many pixels for that byte budget β try a slightly larger target or switch the output format to WebP.