Compress a photo or PDF to an exact size

Type the limit your form gives you, or paste its instructions. SizeLock finds the sharpest file that fits, and nothing leaves your device.

Target under 100 KB

More optionsformat, pixel size, PDFs

Format

Pixel size

Drop photos or PDFs here

or paste with Ctrl + V. JPG, PNG, WebP, AVIF and PDF, as many as you like.

Limits people get asked for

Pick one and the bench above is set. Always check the exact numbers on your own form first.

How it picks the sharpest file

Most compressors only turn the quality down. At a tight limit that leaves blocky, smeared photos.

  1. Try several sizes

    For each pixel size it binary-searches the highest quality that still fits under the limit, stopping within 3% of it.

  2. Measure what survived

    Each candidate is compared with your original at the same screen size using SSIM, a standard measure of how much structure an image keeps.

  3. Keep the sharpest

    The candidate with the most detail wins. The card shows its pixels, quality, detail score and every alternative it beat.

One real photo, one 50 KB limit

A 3000 × 2000 photo had to fit under 50 KB (50,000 bytes). Each picture is the same close-up of the result, enlarged back to the original's scale so the damage is visible. SizeLock tried 9 sizes and kept the one with the most detail. Photo by Matthew Wiebe on Unsplash.

Your original: the same close-up of the dog's face
Your original3000 × 2000 px, 794 KB. The reference everything is measured against.
Largest size that fits: the same close-up of the dog's face
Largest size that fits2220 × 1480 px at quality 6, 46,980 bytes. Detail kept: Poor (SSIM 0.828).
Halfway down: the same close-up of the dog's face
Halfway down1650 × 1100 px at quality 11, 48,686 bytes. Detail kept: Fair (SSIM 0.880).
What SizeLock picks: the same close-up of the dog's face
What SizeLock picks1020 × 680 px at quality 31, 49,960 bytes. Detail kept: Good (SSIM 0.914).

Questions

How do I compress a photo to exactly 50 KB?

Drop the photo in and choose 50 KB. SizeLock tries several pixel sizes, finds the highest quality that fits under the limit at each one, compares every result with your original at screen size, and gives you the one that kept the most detail. It lands just under the limit, so you get to use the whole budget.

My form wants a photo between 20 KB and 50 KB. Can it hit a range?

Yes. Choose Between, enter 20 and 50, or paste the form's sentence into “Paste the form's rule”. SizeLock aims for the top of the window rather than the smallest file it can make. If an image is too plain to reach the minimum even at full quality, the card says so instead of handing you a file the portal will reject.

Is a KB 1,000 or 1,024 bytes?

Portals disagree, so SizeLock satisfies both. For a 50 KB limit it stays at or under 50,000 bytes, and for a 20 KB minimum it stays at or over 20,480 bytes. The exact byte count is printed on every result.

Are my files uploaded anywhere?

No. The page reads the file with your browser, re-encodes it on your own processor and hands it straight back. You can check: open your browser's developer tools, watch the Network tab, and compress a file. No request carries your data.

Can it compress a PDF to 200 KB?

Usually. It first rebuilds the PDF losslessly, then recompresses only the photos inside it, so every character of text stays sharp and selectable. If that still is not small enough it tells you, and only flattens the pages into pictures when you turn on “Allow flattening PDFs”, because flattened text can no longer be selected or searched.

Will my photo keep its pixel size?

Not always, and that is on purpose: at a tight limit a slightly smaller picture at good quality looks far better than full size at very low quality. Every card shows the pixels it chose and a table of what else was tried. If you need every pixel, turn on “Keep full resolution”; if the form names exact pixels, set them under More options and they are kept.

Which format should I pick?

Leave it on Auto. Photos become JPG, which every portal accepts. Pick WebP only if the site accepts it, because it looks better at the same size. PNG has no quality setting, so use it only for transparency or sharp line art.

Does it work offline?

Photos do, once the page has loaded. PDF support loads its engine the first time you add a PDF, and after that it works offline too.