How to compress an image to a specific size, from 20 KB to 2 MB

Get a photo under 20 KB, 50 KB, 100 KB or 2 MB: what fits at each size, why KB counts differ, and how to meet a form’s limit without a blurry result.

· 6 min read

Exam portals want a photo under 50 KB. Some visa forms allow up to 240 KB. Many websites stop uploads at 1 or 2 MB, and email services cap attachments at 20–25 MB per message. A phone photo, meanwhile, is usually 2–5 MB. Getting under a limit by trial and error, nudging a quality slider and saving again, is slow. This guide explains what fits at each size and how to hit a target in one step.

What decides file size

Three things, in order of how much they matter:

  1. Dimensions. File size grows with the number of pixels. Halving the width and height leaves a quarter of the pixels and roughly a quarter of the file.
  2. Quality. For JPG, WebP and AVIF, lower quality discards more detail. It is powerful in the middle of the scale, but below a point the image turns blocky.
  3. Format. At the same quality, WebP and AVIF files are smaller than JPG. Most forms only accept JPG, though, so that is usually fixed.

The picture itself matters too. A portrait against a plain wall compresses far better than a photo of leaves or gravel, so two photos at the same target can end up with different dimensions. Noise from low light also costs bytes, which is one more reason to take form photos in daylight.

What fits at each size

A rough guide for a typical photo saved as JPG. Detailed photos land at the low end of each range, simple ones at the high end.

TargetCommon usesTypical width that stays sharp
20 KBSignatures, some exam and ID photosAbout 400–600 px
50 KBExam, job and ID portals, profile photosAbout 600–1,000 px
100 KBVisa and job forms, thumbnails, email signaturesAbout 1,200–1,600 px
200 KBScanned documents, marketplace and website imagesAbout 1,600–2,000 px
500 KBWebsite uploads, forums, bannersOften the full phone photo, at a lower quality
1 MBEmail, chat and many website upload limitsFull resolution for most phone photos
2 MBJob sites, online stores, high-resolution camera photosFull resolution at high quality

Many forms also set pixel dimensions, such as a minimum width or an exact passport-photo size. Check both rules before you start: a file can be small enough and still be rejected for being too small in pixels.

Why a KB is not always a KB

Some software counts a kilobyte as 1,000 bytes and some as 1,024. macOS Finder uses 1,000. Windows File Explorer uses 1,024 but still writes “KB”. So a 50,000-byte file is 50 KB on a Mac and about 48.8 KB on Windows. Upload forms can use either.

Graviton counts 1 KB as 1,000 bytes and 1 MB as 1,000,000 bytes. That is the stricter reading: a file under 50 KB in Graviton is under 50 KB on every form, whichever way it counts.

How to hit a target in one step

  1. Open the compress to any size tool, or a preset such as 50 KB.
  2. Drop your photo in. JPG, PNG, WebP, AVIF and iPhone HEIC all work.
  3. Under Goal, keep “Exact file size”, which is selected by default, type the limit and pick KB or MB. Chips for 20 KB to 2 MB are there for the common ones.
  4. Keep the format as JPG unless your form accepts something else.
  5. Download the result with a free account. It is at or just under your target.

Behind the scenes, Graviton encodes the image several times and keeps the highest quality that fits. “Shrink dimensions if needed” is off by default, so the photo keeps its width and height, which is what you want when the form demands exact pixel dimensions. If reaching the target would need very heavy compression, Graviton shows a note with a one-click “Shrink dimensions to fit”: it shrinks the dimensions a little at a time, because a slightly smaller sharp photo looks better than a full-size blocky one. If the target is out of reach, the result is marked “Over target” and you get the smallest version it could make.

Compress an image to any size in KBType the size your form asks for and get the sharpest image that fits, without uploading it.

Tips for very small targets (20–50 KB)

  • Crop first. Every pixel of background takes bytes away from your face or signature. Crop in your phone’s photo editor before compressing; Graviton resizes but does not crop.
  • Use a plain, light background and even daylight. Plain areas and low noise compress well.
  • For signatures, sign with a dark pen on white paper and photograph it without shadows. The signature compressor aims for 20 KB.
  • If the form gives a range, such as 20–50 KB, set the maximum. Graviton keeps the highest quality that fits, so the file lands just under the top of the range.

Applying for an exam or a job? The exam photo compressor is set up for the common 50 KB photo limit.

Larger targets (500 KB to 2 MB)

At these sizes the job is easy and the result usually looks the same as the original. Most phone photos only need a lower quality setting and keep their full resolution. It is also a good moment to convert iPhone HEIC photos to JPG, since many upload forms reject HEIC: with the format set to JPG or “Same”, they come out as JPGs that fit.

Several photos to send? Drop them all in. Each one is compressed to the target on its own, and you can download them together as a ZIP that keeps the original names.

Screenshots, PNGs and GIFs

PNG is lossless, so it has no quality slider in the usual sense. When you set a size for a PNG, Graviton reduces the number of colors in its palette until the file fits, then shrinks the dimensions if you allow it. That works well for screenshots and graphics. For photos, converting to JPG reaches small sizes far more gracefully.

Animated GIFs can be squeezed to a size too, for chat apps with an upload limit. The GIF compressor raises compression step by step, then reduces colors and, with “Shrink dimensions if needed” on, dimensions, keeping every frame.

Doing it by hand

You can hit a target without a dedicated tool. In Photoshop’s Export As dialog, or GIMP’s JPEG export with the image preview turned on, the estimated file size updates as you move the quality slider. Resize first, lower the quality until you are under the limit, and check that the result still looks right. It works, but it takes several attempts per photo, which is exactly the loop Graviton automates.

Whichever way you do it, Graviton runs on your device and your photos are never uploaded, which matters for ID photos and signatures. Trying sizes is free and needs no account. A free account covers 3 downloads a day, and downloading the same photo again at another size on the same day, on the same device, does not count again.