CompressToFit

Image compressor

Compress image to any size

Type the size the form is asking for and this hits it. An image encode costs about fifteen milliseconds, which is cheap enough to stop guessing -- so quality is bisected against the real byte count across roughly eight attempts, and you are handed the best-looking one that genuinely measures under your number. All of it in this tab, on your own machine.

Takes JPEG, PNG, WebP, AVIF, GIF and BMP

Step 1: where are you sending it?

1Where is it going?

2Add your file

Video, images and PDFs, all compressed on your own machine. No upload, no account, no watermark, no limit on how many files.

Why this one

What this does that an upload-based image compressor cannot

Three differences, each of them a consequence of where the work happens rather than a feature that could be added.

A number, not three named levels

Low, recommended and extreme are what you offer when you cannot afford to encode the file more than once. Nothing is uploaded here, so your own machine can try it as many times as it takes to land on the size you asked for.

Nothing is uploaded, ever

There is no server in this product. The file is read, compressed and handed back inside this browser tab, which is why there is no queue, no account, and no deletion policy to trust -- nothing was ever sent.

Measured, not estimated

The finished file is weighed at every attempt, and what you are given is the best result actually observed under your limit -- not the one a formula predicted would fit.

Pick your number

Compress image to an exact size

Each of these is this same tool with the target already set. If the size you need is not here, type it.

Mechanism

How it hits the number

Four steps. The byte count is measured at every one of them.

  1. 01

    The image is read locally

    Dimensions, megapixels and format come straight out of the file, in your browser. Nothing is decoded on a server and nothing is sent.

  2. 02

    A format is chosen for you

    JPEG, because a JPEG opens on everything ever made -- unless the source could carry transparency, in which case WebP, so the alpha channel survives instead of being flattened onto white.

  3. 03

    Quality is bisected against real bytes

    Too big, try lower; comfortably under, try higher. About eight encodes of roughly fifteen milliseconds each, each one weighed, which is why the result lands just under your limit rather than far below it.

  4. 04

    Pixels go before quality does

    If even the lowest quality is too large, the image steps down a dimension rung and the search restarts. Fewer pixels reads as a smaller photo; heavy JPEG on a full-size one reads as a broken photo.

Form requirements

Filling in an official form?

These specify more than a byte cap — dimensions and a format too — so each gets the whole requirement rather than just the number.

Questions

Compressing image

Is this image compressor really free?
Yes, with no tier above it. Compression runs on your own hardware, so a file costs us nothing to process -- there is no bandwidth bill and no server time to recover, and therefore nothing to ration. Unlimited files, no account, no watermark, no daily cap, and no "upgrade to unlock stronger compression", because the strongest setting was never being withheld.
Where does my file go?
Nowhere. It is read, compressed and handed back inside this browser tab using your machine's own encoders. There is no server in this product to send it to, which is a different claim from "we delete your files after an hour" -- nothing was uploaded, so there is nothing to delete and no retention policy you have to take on trust.
Is there a file size limit on the image I can compress?
Not one we impose -- there is no upload to cap. The practical ceiling is your own machine's memory, which in a current browser means files far larger than anything you are likely to be compressing. Targets run from 20KB up to 1MB as one-click presets, and you can type any number in between.
Do I have to sign up or install anything?
No. There is no account, no email, no extension and no desktop installer -- the page you are reading is the whole application. It works offline once loaded, because at that point everything it needs is already in the browser.
Is shrinking an image the same as compressing it?
Yes. Shrink, compress and reduce the file size all name one job here: making the file smaller in bytes while it still works as an image. The word that means something else is resize -- changing the pixel dimensions, which is one lever compression pulls rather than a synonym for it. This tool is pointed at the byte count. You give it the number and it gets there by whichever route costs the least quality, which sometimes means handing back fewer pixels rather than worse ones and always means the result is measured rather than assumed.
What happens to a transparent PNG?
It comes back as a WebP rather than a JPEG, because JPEG has no alpha channel and flattening transparency onto white would be a permanent, silent change to the image. PNG itself is lossless and so cannot be aimed at a byte target at all, which is why the format changes.

Other files

Holding something else?

The same tool, and the same guarantee. Each family reaches your number a different way, because each has a different dial to turn.

Background

Worth reading

The arithmetic behind the number, and what to do when it will not fit.