Compress an image to an exact file size

Set the file size you need and the compressor finds the highest quality that fits under it. Your images are processed on your own device and are never uploaded to a server.

No upload No file size limit No sign-up Free

Drop images here

or click to choose — JPG, PNG, WebP, GIF, BMP — multiple files supported

Target file size

If quality reduction alone cannot reach the target, the image is scaled down — but never below the minimum width you set here.

Why an exact file size matters

Most image compressors ask you to pick a quality percentage and then hope the result is small enough. That is the wrong way round. In practice you rarely care about quality settings — you care that an upload form accepts the file. University applications, visa portals, job boards, government e-service sites and older content management systems all enforce hard ceilings, and they reject anything one byte over.

This tool works backwards from that constraint. You give it the ceiling, and it finds the highest quality that stays underneath. That is a different operation from “compress at 70%”, and it is the one that actually gets your form submitted.

How the compression works

When you press Compress, the image is decoded and re-encoded through your browser's Canvas API. The tool runs a binary search across the quality range: it encodes at a mid-point quality, measures the resulting byte size, and then moves the search window up or down depending on whether the result fits. After nine passes it has converged on the highest quality that stays under your target, usually within a few hundred bytes of the ceiling.

Quality reduction alone is not always enough. A 48-megapixel phone photo squeezed to 50 KB would look like mud even at the lowest quality setting, and sometimes it simply cannot get there at full resolution. When that happens the tool scales the pixel dimensions down by 15% and repeats the quality search, looping until the target is met. The minimum width field is your guardrail: the image will never be scaled below it, so you stay in control of how much resolution you are willing to trade.

If the target still cannot be reached at your minimum width, the tool tells you instead of silently returning an oversized file. Lower the minimum width or raise the target and run it again.

Common size limits and what they are for

Target Typically required by Realistic result
50 KB Older government portals, ID photo uploads Expect visible softening; keep dimensions small
100 KB Exam applications, visa forms, job portals Good for photos up to roughly 1000 px wide
200 KB Forum avatars, CMS thumbnails, email attachments Comfortable quality at 1200–1600 px
500 KB Blog images, product listings, marketplace photos Near-original quality at full width
1–2 MB Print submissions, high-resolution portfolios Barely distinguishable from the source

Choosing between JPEG and WebP

JPEG is the safe default. Every upload system built in the last thirty years accepts it, and if you are compressing for a form on someone else's website, that compatibility is worth more than a few kilobytes.

WebP reaches the same perceived quality at roughly 25–35% smaller file sizes, which means less scaling and a sharper result for the same ceiling. Use it when you control the destination — your own site, an app you are building, or storage you manage. Avoid it for third-party forms that have not been updated in years.

PNG is not offered as an output. PNG is lossless, so it has no quality dial to turn — the only way to shrink it is to reduce dimensions or colour depth. For photographs it produces files several times larger than JPEG at the same visual quality. If your source is a PNG, converting it to JPEG or WebP here is exactly what you want.

Getting better results at small targets

Your files stay on your device

There is no upload step here. The compression happens in your browser using standard web APIs, which means your images are never transmitted, never written to a server, and never retained. It also means there is no queue, no daily limit and no file size cap — the only real constraint is your device's memory.

A useful side effect: re-encoding through a canvas discards EXIF metadata. GPS coordinates, camera serial numbers and timestamps are stripped from the output, which is usually what you want before posting a photo publicly.

Frequently asked questions

Are my images uploaded to a server?

No. The compression runs inside your browser using the Canvas API, so the image file never leaves your device. You can confirm this by opening your browser's network tab, or by disconnecting from the internet after the page loads - the tool still works.

Is there a file size limit?

There is no limit imposed by this site. Because nothing is uploaded, the practical ceiling is your device's available memory. Very large images (above roughly 50 megapixels) may be slow on older phones.

Why can't my PNG reach the target size?

Screenshots and images with sharp text compress poorly. The tool converts to JPEG or WebP to reach small targets, and if quality reduction alone is not enough it scales the pixel dimensions down. If the result still misses the target, the image needs smaller dimensions than the ones you set as the minimum.

Does compressing an image lose quality?

JPEG and WebP are lossy formats, so yes - some detail is discarded. The tool searches for the highest quality setting that still fits your target, so you lose the least amount possible for that file size. Compressing an already-compressed JPEG a second time degrades it further.

Which format should I choose?

Use JPEG when the destination is a government form, a job portal, or any older upload system, because support is universal. Use WebP when you control the destination, such as your own website - it typically reaches the same visual quality at 25 to 35 percent smaller file sizes.

Does the tool remove EXIF data?

Yes. Re-encoding through a canvas discards EXIF metadata, which means GPS coordinates, camera model and timestamps are stripped from the output. This is usually desirable when uploading photos publicly.