CompressToFit

Image target

Compress image to 20KB

Drop a photo or screenshot below and it is re-encoded on your own machine to land under 20KB. Because an image encode takes about fifteen milliseconds, this does not guess at a quality setting -- it tries roughly eight of them, weighs the result of each, and hands back the best-looking one that genuinely measures under 20KB. Nothing is uploaded and there is no watermark.

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.

The same tool takes video, images and PDFs, at this size or any other.

Mechanism

How this works

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

  1. 01

    Your browser reads the image

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

  2. 02

    A size and a format are chosen

    Output is JPEG, because a JPEG opens on everything ever made -- unless the source could carry transparency, in which case it is WebP so the alpha channel survives.

  3. 03

    Around eight encodes, each measured

    An image encode costs about fifteen milliseconds, which is cheap enough to stop guessing. Quality is bisected against the real byte count: too big, try lower; under 20KB, try higher.

  4. 04

    The best one that fit is yours

    You get the highest quality actually observed under 20KB. If even the lowest quality is too large, the image steps down a dimension rung and the search starts again -- fewer pixels, not worse ones.

Questions

Compressing image to 20KB

How do I compress an image to 20KB?
Drop the file into the tool on this page -- the target is already set to 20KB. The work happens in your browser on your own machine, so there is no upload, no queue and no account. The output is measured before you are given it, so it is genuinely under 20KB.
Is that exactly 20KB, or approximately 20KB?
Under it, and verified. The byte count of the finished file is measured and compared against the limit before anything is handed back, and if it came in over, it is done again. 20KB here means 20 decimal kilobytes -- 20,000 bytes -- which is the smaller of the two readings a platform might intend, so it clears either.
Will my photo still be usable at 20KB?
For the common case -- a phone photo or a screenshot going into an upload form -- yes. Quality is searched rather than fixed, so you get the best setting that fits rather than a preset guess. Below about 50KB a full-resolution photo has to lose pixels as well as quality, so it is downscaled rather than smeared, and you see the dimensions you will get before committing.
What happens to a transparent PNG?
It becomes 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 therefore cannot be aimed at a byte target at all.

Nearby

Other sizes

Landed on the wrong number? The right one is one click away.

Other files

Not what you were holding?

Each family reaches your number a different way, because each has a different dial to turn.

Background

Worth reading first

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