Compress Image to Any Size Online

Type the exact size you need in KB or MB, and our compressor finds the highest quality that still fits. Runs entirely in your browser.

How to Compress an Image to a Target Size Online for Free

Set any file size limit and compress to it in three steps: add images, enter the target in KB or MB, then download the result or one ZIP.

Step 1

Add Your Images

Step 1. Drop one photo or a whole batch of JPG, PNG, or WEBP files into the tool to begin.

Step 2

Enter Target Size

Step 2. Type any number, choose KB or MB, then pick JPEG, WEBP, or PNG as the output format.

Step 3

Download Result

Step 3. Check the final size and saved percentage, then download files individually or all as a ZIP.

Compress Images to Any Exact Size Without Guessing Quality Sliders

Nearly every upload form on the web enforces a file size ceiling, and the number is rarely round: 100 KB for a visa photo, 2 MB for a job portal, 500 KB for a university admission page, 20 KB for a government ID upload. A phone camera produces files of three to eight megabytes, so almost every photo fails on the first attempt. The usual workaround is a quality slider, which forces you to guess, export, check, and repeat until the number lands under the cap; guessing is slow and usually overshoots. Compressing to a target size inverts that: you state the limit and the tool works backwards to the best image that fits inside it.

This tool asks for the number, not the quality. Once your image is decoded onto a canvas, it binary-searches encoder quality, halving the range after every pass until it finds the highest setting that still lands under your target. That matters because quality is not linear: the gap between quality 70 and 80 can be hundreds of kilobytes on one photograph and almost nothing on another, so any fixed preset is guesswork. Every pass measures the real encoded file instead of estimating from a formula, which is why the result matches the byte budget you set. When no quality level is low enough on a very large original, the tool reduces resolution in gentle 15 percent steps and re-runs the search, stopping the moment the cap is met.

PNG behaves differently, and the tool handles that honestly. PNG is lossless, so the quality argument that browsers accept for JPEG does nothing to it. The tool therefore tries a true-colour PNG first: if that fits your target, you get a mathematically lossless result and nothing else happens. When it does not fit, the tool switches to indexed PNG built from a median-cut palette, stepping down through colour counts until the file fits, and it reserves a transparent palette entry so fully transparent pixels stay transparent. This path matters most for screenshots, logos, and line art, which carry far more detail per byte than photographs do.

Batch work is built in. Drop as many files as you like, set the target once, and each image is measured and compressed independently, so a mixed folder of small screenshots and large camera photos all land under the same cap. Every finished file is listed with its before and after size, the quality or colour count used, the final dimensions, and the percentage saved; anything that cannot reach the target is labelled rather than quietly returned oversized. Downloading everything at once produces a ZIP assembled inside the browser, with no third-party library and no server round trip. Because decoding, encoding, and archiving all happen on your device, nothing is uploaded or retained, and there is no watermark, account, or daily limit.

Use this page when the limit is unusual, when you want to try a few numbers, or when a form states a cap that has no page of its own. If your form asks for a round number such as 100 KB, 200 KB, or 1 MB, the dedicated page for that exact size saves you the typing. Two honest boundaries are worth knowing before you start. A file that is already under your target and already in the format you selected is passed through untouched, so you never receive a larger or re-encoded copy. And this is a compressor, not an editor: it does not crop, it does not resize to exact pixel dimensions, and its output is limited to JPEG, WEBP, and PNG.

Exact Target

Type any number in KB or MB, and the output is measured against it after every encoding pass.

Smart Quality

A binary search finds the highest quality that still fits, instead of a fixed preset that overshoots.

Format Choice

Export as JPEG for photos, WEBP for smaller files, or PNG when transparency and sharp edges matter.

Auto Downscale

If quality alone cannot reach your number, resolution drops in 15 percent steps until it does.

Batch & ZIP

Compress a whole folder to one cap, then download every result together in a single ZIP archive.

Private & Free

Everything runs locally in the browser, so nothing is uploaded, watermarked, metered, or stored.

FAQ

Frequently Asked Questions

Upload your image, type the size you need, and select KB or MB. The tool binary-searches encoder quality until the output fits, then shows the final size, quality used, and percentage saved before you download.

Any number you like, in kilobytes or megabytes. Enter 20, 75, 400, or 3000 and the tool works to that cap. Round limits like 100 KB also have dedicated pages if you prefer a preset button.

It keeps as much as the limit allows. The search stops at the highest quality that still fits rather than at a fixed preset, so you never lose more detail than the cap forces. Below roughly 50 percent quality, soft blocking becomes visible.

JPEG is the safe default for photographs and is accepted by virtually every portal. WEBP usually produces files 25 to 35 percent smaller at the same visual quality. Choose PNG for screenshots, text, or transparency.

Only when it has to. Quality is reduced first, and resolution drops in 15 percent steps only if no quality level reaches your target. Clear the Allow Downscaling checkbox to keep the original pixel dimensions.

The tool says so instead of returning an oversized file. Each result is labelled under target or above target, and if even the lowest quality and smallest scaling fail, the smallest possible output is still returned and flagged.

No. Decoding, re-encoding, and ZIP packaging all run inside your browser tab using canvas and built-in encoders. Your files never leave the device, so there is nothing stored, logged, or transmitted to review.

Yes. Drop a whole folder, set the target once, and every file is compressed independently against that cap. You can download results one by one or grab them all together in a single ZIP archive.

If the file already fits and you are staying in the same format, it is passed through untouched, so you never receive a re-encoded or larger copy. Choosing a different output format always triggers a fresh encode.

Yes. A standard compressor hands you a quality slider and leaves you guessing whether the result fits. This one takes the byte budget first and solves for the best quality inside it, which is what upload forms actually enforce.