ThumbCraftedTry Free Editor
Free · Private · No Upload

Compress an Image to an Exact Size

And an honest answer when your target is not achievable.

Name a target in KB and this finds the highest quality that fits under it. It also measures how much damage that did and tells you plainly when a target is not reachable at your current resolution, instead of handing you mush and calling it done.

Drop or click to upload

Drag & drop or paste from clipboard

JPG, PNG, WebP — 25MB max

100% private No sign-up Measured, not guessed
Searching for the best quality that fits…

Original

Your original image

Compressed

The compressed result

Why "compress to 20KB" is often a request that cannot be met

Every tool that offers to compress an image to an exact size will produce a file at that size. Not all of them will tell you the picture is ruined. That is the difference this page is built around.

File size is not a dial you turn independently of everything else. It is the outcome of three things: how many pixels you have, how much detail is in them, and how hard you compress. Fix the first two and the third has a floor. Push past the floor and JPEG starts throwing away information you can see going: edges smear, flat areas break into blocks, and text develops a halo.

What the quality number here actually means

Most compressors report the quality setting they used, which tells you what they asked for rather than what happened. This page reports PSNR, measured by decoding the compressed result and comparing it pixel by pixel against your original. It is a real measurement of the difference between two images, in decibels, on a logarithmic scale.

PSNRWhat you would see
Above 40 dBEffectively identical. You would not spot the difference side by side.
35 to 40 dBVery good. Differences exist but need a careful eye on fine detail.
30 to 35 dBGood. Slight softening in busy areas. Fine for most web use.
25 to 30 dBVisible. Blocking around edges and text, noticeable in flat gradients like sky.
Below 25 dBDamaged. Obvious artifacts. This is where the tool stops agreeing with you.

PSNR is not a perfect model of human vision, and it is worth saying so. It slightly over-punishes noise and under-punishes blur. What it is very good at is telling you the direction and rough scale of the damage, which is exactly what you need in order to decide whether a target is sensible.

The fix when a target really is too small

If the target cannot be met at a decent quality, the answer is almost never "compress harder". It is fewer pixels. Halving both dimensions cuts the pixel count to a quarter, and that buys far more file size than turning the quality dial down ever will, at much lower visible cost.

This is why the tool offers to find the largest dimensions that hit your target while keeping quality in the good range, rather than just squeezing the resolution you started with. A sharp 640 by 360 image at 20KB looks better than a wrecked 1280 by 720 image at 20KB, every time.

Practical targets worth knowing

If you only want the file smaller without a specific number in mind, the plain image compressor is the simpler tool. To change dimensions directly, use resize and convert.

Compression Questions

Why won't this just give me the exact size I asked for?
It will, whenever the target can be met without destroying the image. When it cannot, it tells you, because a file at the right size that nobody wants to look at has not solved your problem. It also offers the fix that does work: reducing the dimensions instead of compressing harder.
How does it find the right quality setting?
By binary search. It encodes the image at a quality level, measures the actual bytes, and narrows the range until it finds the highest quality that still fits under your target. That is around ten encodes, all in your browser, which is why it takes a moment on a large photo.
What is PSNR and why should I care?
Peak signal-to-noise ratio: a measurement in decibels of how much the compressed image differs from your original, computed pixel by pixel. Above 40 is effectively identical, 30 to 35 is good, and below 25 has visible damage. It is measured on your actual image rather than estimated from the quality setting.
Is my image uploaded to a server?
No. Every encode and the PSNR comparison run on a canvas in your browser. Nothing leaves your device, which is also why there is no size queue and no account.
Should I choose JPG or WebP?
WebP will usually hit the same target at noticeably better quality, often 25 to 35 percent smaller for the same appearance. Choose JPG when something downstream needs it, such as an older upload form or a printer. Both are supported everywhere that matters on the web now.
Why did my PNG get much bigger as a JPG, or vice versa?
They are built for different content. PNG is lossless and excels at flat colour, sharp edges, screenshots and anything with transparency. JPG is lossy and excels at photographs. A screenshot saved as JPG looks smeared around the text; a photograph saved as PNG can be several times larger than it needs to be.
Will compressing remove my photo's metadata?
Yes. The result is re-encoded from a canvas, so the original EXIF block including GPS is not carried over. If stripping metadata is your actual goal and you do not want to lose quality doing it, use the EXIF remover, which removes it without re-compressing.

Continue crafting

Keep going without re-uploading — your image carries over to the next tool automatically.

  1. 1PreviewCheck how it looks when shared
  2. 2EditAdd text, effects, or a fresh background