Compress Image to Target Size (KB)

Shrink a JPG, PNG or WebP image down to an exact file-size limit — type the maximum KB (or pick a preset), and the tool finds the best quality that fits. Perfect for exam-form photo and signature uploads that demand “under 50 KB”. Everything runs locally, so nothing is uploaded. Last reviewed 2026-06-19.

Drop an image here, or browse

JPG, PNG, WebP, GIF, BMP — processed locally, never uploaded.

How it works

Many upload forms reject an image that is over a hard size limit — a typical exam portal wants the photo under 50 KB and the signature under 20 KB. This tool draws your image onto an HTML <canvas> and re-encodes it as JPEG or WebP, running a binary search on the quality to find the highest setting whose file is still under your target. If even the lowest quality is too large, it steps the dimensions down and tries again, so it always lands just under the limit (never over). Because it all happens in your browser, the picture is never sent anywhere, and the re-encode strips EXIF/GPS as a side effect.

Common target sizes

TargetTypical use
20 KBSignatures on exam forms (SSC, IBPS, UPSC)
50 KBPassport-style photos on most government / exam portals
100 KBGeneral web images, profile pictures, KYC uploads
200 KBEmail attachments, document scans
500 KBHigher-quality web photos
1 MBPrint-ish quality while staying under 1 MB

Tips to hit a tiny target

  • Crop tight first. A photo cropped to just the face (or just the signature) compresses far smaller than one with lots of background.
  • Choose WebP when the form accepts it — WebP reaches the same target at noticeably higher visual quality than JPEG, or hits a smaller target JPEG can’t.
  • Leave “Resize if needed” on for very small limits (≤ 20 KB). A 20 KB signature usually needs both low quality and smaller dimensions.
  • Match the required pixel size. If a form says “200×230 px”, resize to that first — there is no point encoding more pixels than the form keeps.

Good to know

  • The result lands just under your target (e.g. ~47 KB for a 50 KB limit) so the upload is always accepted.
  • PNG is lossless and can’t be tuned to a KB target by quality, so the output is JPEG or WebP — which is what KB-limited forms expect anyway.
  • Animated GIFs / animated WebP are flattened to their first frame (canvas captures a single frame).
  • Your original file is never modified; you always download a new copy.

Frequently asked questions

Is my image uploaded to a server?
No. The image is decoded and re-encoded entirely in your browser using the built-in Canvas API — it never leaves your device and is never logged or transmitted. It also works offline once the page has loaded, so it is safe for private photos, ID documents, signatures and exam-form uploads.
How does it hit an exact size like 50 KB?
JPEG and WebP have a quality dial from 1 to 100 — lower quality means a smaller file. The tool runs a binary search on that quality to find the highest setting whose encoded size is still under your target, so you get the best-looking image that fits the limit. If even the lowest quality is too big, it automatically shrinks the dimensions a step at a time until the target is reachable.
Why does it compress to a JPG and not keep my PNG?
PNG is lossless — it has no quality dial — so you cannot reliably tune a PNG to an exact KB target; only its dimensions affect its size. Almost every form that imposes a KB limit wants a JPG anyway. So this tool outputs JPEG (or WebP), which is exactly what those uploads expect. If you specifically need a smaller PNG, use the regular Image Compressor and resize it.
The result is a bit under my target, not exactly equal — is that a problem?
No, that is by design and is what you want. A "≤ 50 KB" limit means the file must not exceed 50 KB, so the tool always lands just under the target (e.g. 47–49 KB for a 50 KB limit) rather than risk going over. Landing slightly under guarantees the upload is accepted.
What if my target is too small to reach?
If even the lowest quality at the smallest sensible dimensions is still larger than your target, the tool gives you the smallest version it could make and tells you it could not reach the limit. Try enabling "Resize if needed", choosing WebP (it compresses harder than JPEG), or raising the target a little.
Does it remove EXIF / GPS metadata?
Yes. Re-encoding through the canvas produces a clean image with no EXIF block, so camera model, date and GPS location are stripped automatically — a privacy bonus when uploading photos. Keep your original if you want to preserve that metadata.

Related tools

See all browser tools →

Explore more tools

Browse all 42 tools →