Compress an Image to an Exact Size: 20KB, 50KB, 100KB or 200KB

Set the file size you need, upload nothing, and get a JPEG that actually passes the form's limit — plus the pixel size you asked for.

Image compressor

Processed on your device — never uploaded

Drop an image here, or click to choose one JPG, PNG, WebP, BMP, GIF or AVIF · up to 40 MB · you can also paste from the clipboard Your file is never sent to a server.
Target file size 100 KB
KB

Budgeting 99,936 bytes, a little under the limit so the form does not reject the file at the boundary.

Pixel size (optional) Leave blank to keep the original

Files are processed on your device. Nothing is sent to a server.

Hard limit on a form? Enter the exact number the form asks for. We budget a few bytes under it so the upload does not get rejected at the boundary.

If the target is too small for the photo, lower the pixel width as well. Quality alone runs out of room. Transparent areas become white in the JPEG.

Why "compress to 20KB" is a different job from "make it smaller"

Most image compressors answer "how do I make this file smaller?" That is not what people type. They type a number, because something demanded a number: a job portal capping a photo attachment, a visa application wanting a headshot inside a byte range, an exam form asking for a signature under 20KB, a marketplace that rejects anything over 100KB.

Advertisement

Those forms ignore what a generic compressor does well. The limit is a hard ceiling — 20KB means 20KB, and 24KB is a failed upload. And the limit is often a range: many portals reject a file that is too large and also flag one that is suspiciously small, so "as small as possible" is wrong too. You need to land inside a window.

This tool is built backwards from the number. You give it the budget, and it searches for the best quality that still fits.

The byte trap: 20KB is two different numbers

"20KB" is ambiguous, and the gap is big enough to get you rejected. If a form means 1 KB = 1,024 bytes, the ceiling is 20,480 bytes. If it means 1 KB = 1,000 bytes — how storage and many forms count — it is 20,000 bytes. A file of 20,300 bytes passes one reading and fails the other.

This tool budgets against the stricter number by default, so a result it reports as 19.8KB passes either reading. If the form states an explicit byte cap, enter that cap instead of converting it to KB.

How the compressor reaches a target

Only two levers shrink an image file: lower the encoder quality, or make the image physically smaller. Using only the first is why so many tools return 40KB when you asked for 20KB, or a blocky mess when a modest downscale would have looked better.

This tool uses both, in order:

  1. Re-encode at a guessed quality. The image is drawn to a canvas and exported as JPEG at a quality from 0 to 1.
  2. Measure the real bytes. The exported blob's actual size is compared with your budget — never estimated from the original.
  3. Narrow the quality. Too big and quality drops; comfortably under budget and it climbs. Each pass halves the search window, so it settles in a handful of exports.
  4. Downscale when quality runs out. If even low quality overshoots, the long edge shrinks and the search restarts. This is what makes 20KB achievable for a phone photo.

Everything runs in your browser tab on the canvas API. No upload, no queue, no server round trip — it keeps working if you disconnect after the page loads.

Advertisement

Compress an image to 20KB

20KB is the tightest common target, and the one where pixel dimensions decide the outcome. A 12-megapixel photo holds far more detail than 20,000 bytes can describe, so the tool shrinks the long edge as well as the quality. For a headshot read at form size, a long edge of 160–400 pixels looks clean at this budget; bigger mostly adds bytes the form does not want.

Typical cases: exam and recruitment portals wanting a signature or a small photograph, ID uploads with a stated ceiling, and older systems built for slow connections. Two notes:

  • If the form also says "160 pixels", set the width in the pixel fields before compressing. Resizing afterwards puts you back over budget.
  • Signatures and line art compress badly as JPEG until they are downscaled, because they are mostly white space. If the first result is muddy, cut the pixel width and re-run rather than pushing quality lower.

Compress an image to 50KB

50KB is comfortable for a portrait or a document scan read on screen. You can usually keep 600–900 pixels on the long edge and still fit, which is enough to look sharp in a profile card or a form preview. The quality search does most of the work here and downscaling is rare — so try 50KB first when you are unsure what a form accepts, and step down to 20KB only if it is rejected.

Compress an image to 100KB

A 100KB ceiling is what most portals, email attachments and CMS upload fields use. At 100KB a phone photo can generally keep its dimensions up to about 1,200 pixels on the long edge without visible softening. For a website rather than a form, 100KB is a reasonable hero-image default and well under any performance budget. Need specific dimensions too? Set the pixels first, then the KB target.

Compress an image to 200KB and 500KB

Above 200KB the goal shifts from "squeeze it in" to "strip waste". These limits usually come from marketplace listings, print-on-demand uploaders or a mail server attachment cap. At 200–500KB the tool normally keeps full resolution and removes encoder redundancy, so the result is visually indistinguishable at normal viewing size. If you have to choose between this and a resize, compress first: a re-encoded 400KB file often looks identical to the 2MB original, while a downscaled one stays small forever.

Set exact pixel dimensions

Many forms specify pixels instead of KB, or specify both. The common ones have a straightforward answer:

  • 160 pixels wide — enter 160 as the width. Leave height blank to keep the aspect ratio, or fill both if the form gives a box.
  • 2 × 2 inches — at the 300 DPI that print and ID systems assume, that is 600 × 600 pixels. At 72 DPI it is 144 × 144, the number to use when the form means screen pixels.
  • 35 × 45 mm (common passport photo size) — at 300 DPI that is about 413 × 531 pixels.
  • 600 × 600 — fill both fields; the tool fits or stretches depending on what you pick.

If a form gives both a pixel box and a KB ceiling, work in this order: pixels first, then compress. The other way round means the resize pushes the finished file back over the limit.

JPG, PNG or WebP — which one to feed it

The tool accepts JPG, PNG, WebP and most formats a browser can decode, and outputs JPEG — what forms accept, and the one that reliably hits small byte targets.

Caveat: a PNG screenshot or a flat-background logo converted to JPEG can show fringing around text and edges. For document screenshots, a downscaled PNG often reads better at the same byte count. If the form only takes JPG, cut the pixel width first and let the tool keep quality as high as it can.

If it can't reach your target

Three cases where no compressor can honestly hit the number:

  • The file is already compressed. Going from 20KB to 10KB throws away real information. The tool will get there; the result will look it.
  • The source is huge and detailed. A 6000-pixel scan at 15KB is not going to be readable. Cut the pixel width until the content is still legible, then set the KB target.
  • You need a minimum, not a maximum. Some portals reject files below a floor. If yours is too small, raise the target slightly rather than padding the file.

When the target really is unreachable at acceptable quality, the tool says so instead of silently returning an oversized file. That is the moment to change pixels, not quality.

Your image never leaves your device

There is no upload endpoint on this page. The file is read with FileReader, drawn to a canvas and exported locally; the result is a blob URL in your own tab. Nothing reaches a server, nothing is stored, no account exists — which matters when the image is your passport photo, your signature, or a scan of an ID. To verify, watch your browser's network panel during a compression: no request carries image data.

Check the result before you submit

Look at two numbers on the result panel: the exact byte count, not the rounded KB, and the pixel dimensions. If the form states a range, confirm you are inside both ends. If it says "20KB", confirm you are under 20,480 bytes even if you budgeted 20,000. Then download and check the file's properties on your own machine — that number, not the one this page shows, is what the form reads.

Two related jobs this page does not do: changing an image's pixel dimensions without a size target, and bundling several images into one file. If a form asks for both dimensions and a size limit, set the pixel fields first — the compressor fits the result to your KB budget in the same pass. For any other limit, work down from the largest number the form accepts and step down one preset at a time.

Frequently asked questions

Is 20KB the same as 20,480 bytes?

Not always. If the form counts 1KB as 1,024 bytes, the ceiling is 20,480 bytes. If it counts 1KB as 1,000 bytes, the ceiling is 20,000 bytes. This tool budgets against the stricter figure, 20,000 bytes, so the result should pass either way. If the form states an explicit byte cap, enter that cap in the custom field instead of converting.

Will compressing to 20KB ruin my photo?

It depends on what the photo is for. At 20KB a large photo has to lose pixel dimensions as well as encoder quality, so it will not hold up if you zoom in. At the size a form displays a headshot or signature, it usually reads fine. If it looks muddy, reduce the pixel width and re-run — that is generally cleaner than forcing the quality lower.

Does it work on iPhone and Android?

Yes. It runs in the browser using the canvas API, so it works in Safari on iOS and in Chrome on Android. On iOS, pick the photo from the Photos library; the file is processed locally, so nothing is uploaded and no app is required.

Can it compress a PDF instead of an image?

No. This page handles raster images only — JPG, PNG and WebP in, JPEG out. If you need to shrink a PDF made of scans, convert it back to images, compress each one, and rebuild the PDF. If you need the opposite direction — assembling images into one PDF — that page is not published on SizeGlide yet.

Is my image uploaded to a server?

No. The file is read locally by your browser, resized and re-encoded on a canvas, and the download comes from a blob URL in your own tab. There is no upload request and no storage. You can confirm this in your browser's network panel while a compression runs, and the tool keeps working if you disconnect from the network after the page has loaded.

Advertisement