Compress Image to Exact KB

Shrink a photo to an exact size such as 20, 50 or 100 KB for online forms, with the final size shown in bytes.

Runs in your browser. Files never leave your device.
Choose an image to compressJPG, PNG or WebP · up to 50 MB · processed on your device

About the Compress Image to Exact KB

Shrink a photo to a specific file size, such as 20 KB, 50 KB or 100 KB, for online forms that reject larger uploads: job and university applications, exam registrations, visa and government portals. Choose the image, type the size, and download a JPEG that is at or under it.

The tool tells you the exact final size in bytes, and if the target was too small to reach at full size, how much the picture had to be shrunk. Everything happens in your browser; the photo isn't uploaded.

How it works

JPEG quality controls how much detail is kept, and file size grows with quality. The tool searches for the highest quality whose file is still at or under your target, halving the search range each time (a binary search), so it usually needs about eight to ten tries.

If even the lowest quality (5%) is too big, the image is scaled down in proportion and the search repeats. File size is roughly proportional to the number of pixels, so the scale factor is estimated from √(target ÷ current size), with a safety margin.

1 KB = 1,000 bytes (SI prefix kilo)
Target in bytes = KB × 1,000, rounded down
Find the highest quality q (5%–95%) with size(q) ≤ target
If size(5%) > target: scale ≈ √(target ÷ size) × 0.95, then search again

Some websites mean 1,024 bytes by "KB". Because 1,000 is smaller than 1,024, a file that meets the target here also meets it on those sites.

Assumptions and limits

  • The output is always a JPEG (.jpg), the format almost every upload form accepts. Transparent areas are filled with white.
  • If your file is already a JPEG at or under the target, it is returned unchanged instead of being re-compressed.
  • Phone photos are rotated using their orientation tag before compressing, so they don't end up sideways.
  • The smallest target is 2 KB and the largest is 20,000 KB (20 MB). Input images can be up to 50 MB and 100 megapixels.
  • If the target can't be reached without shrinking the image below 64 pixels on its short side, the tool stops and asks for a larger target instead of producing an unusable picture.

Worked examples

A large phone photo for a 50 KB form limit

A multi-megapixel photo usually can't fit in 50 KB at its full size, even at the lowest quality. In that case the tool scales it down and then finds the highest quality that fits. The result screen shows the final size in bytes and the new dimensions, so you can see exactly what changed.

A small portrait for a 20 KB limit

A small, already-cropped portrait may reach 20 KB just by lowering the JPEG quality, keeping its original dimensions; if it can't, it is scaled down a little. The result shows the quality and the dimensions used, so you can judge whether the face is still clear.

A file that is already small enough

If you choose a 35 KB JPEG and a 50 KB target, nothing needs to change: the original file is returned as it is, so no quality is lost.

Common upload limits and what they mean in bytes

Typing the number shown on the form always works here, because this tool uses the smaller (1,000-byte) definition.

Limit shown on the formBytes if KB = 1,000Bytes if KB = 1,024Target to type here
20 KB20,00020,48020
50 KB50,00051,20050
100 KB100,000102,400100
200 KB200,000204,800200
1 MB1,000,0001,048,5761000

How to use the Compress Image to Exact KB

  1. Choose your image. JPG, PNG or WebP, up to 50 MB.
  2. Enter the size limit in KB. Type the number from the form (for example 50) or tap a preset.
  3. Compress and download. Check the final size and dimensions on the result screen, then download the JPEG.

Frequently asked questions

Will the file really be under the size I enter?

Yes. The tool only accepts a result whose size in bytes is at or below the target, and it shows the exact number of bytes. If the target can't be reached without making the image uselessly small, it tells you instead of giving you a larger file.

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

1,000 bytes, the international (SI) meaning of kilo. Some forms count 1,024 bytes per KB; since 1,000 is the smaller number, a file that passes here also passes there. The result shows the exact bytes so you can compare with any limit.

Why did my image get smaller in pixels?

Very small targets can't hold a large photo even at the lowest JPEG quality, so the tool reduces the width and height until the file fits. The result screen tells you the original and new dimensions whenever this happens.

Why is the result a JPG when I uploaded a PNG?

JPEG compresses photos far better than PNG, and almost every upload form accepts it, so it is the only way to reach small targets reliably. JPEG doesn't support transparency, so any transparent background becomes white.

Does it work for documents and signatures?

Yes, but text and thin lines blur sooner than photos as quality drops. For a scanned document or signature, crop it tightly first and use the largest target the form allows, then zoom in on the result to check it is still readable.

Is my photo uploaded to a server?

No. The image is decoded and re-encoded by your own browser, and the result is created on your device. Nothing is sent to VelixaKit or anyone else.

Sources

This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.