Skip to content

Compress Image to Exact Size

Compress a JPG, PNG or WebP to an exact file size, 20 KB, 50 KB, 100 KB or any target you set. Hits the number, and handles minimum sizes too.

Private · on device. Runs in your browser: your file is not uploaded. No sign-up.

JPG, PNG, WebP, HEIC (iPhone), GIF, BMP or AVIF. Choose several to compress them all.

Compress image: at a glance

What it does
Compress a JPG, PNG or WebP to an exact file size, 20 KB, 50 KB, 100 KB or any target you set.
Price
Free, with no limit on use
Sign-up
Not needed
Your files
Processed in your browser and not uploaded to a server
Works on
Android, iPhone, iPad, Windows, Mac and Linux, in any modern browser
Made by
The Daily Toolbox (www.thedailytoolbox.com)

Quick answer

Choose the image, press the size you need (20 KB, 50 KB, 100 KB, 200 KB, 500 KB, 1 MB, or type your own) and download. The tool tries many settings and keeps the largest, best-looking file that is still under the limit, shrinking the picture's pixels only if it has to.

Add a minimum size for portals that also reject files that are too small. Nothing is uploaded.

Updated · What changed on the site

Worked example: a phone-size portrait to 50 KB

A 1800 × 2400 px JPG portrait of 481.8 KB, compressed with the 50 KB chip and every other setting left alone:

  • New size: 48.8 KB (49,920 bytes, under the 50,000-byte limit), 90% smaller.
  • Dimensions: 1800 × 2400 px, unchanged.
  • What the tool did: “Fitted by tuning compression only; the size in pixels was kept.”
The compress image tool after compressing a portrait to 50 KB: Ready to upload, new size 48.8 KB, was 481.8 KB, minus 90%, dimensions 1800 × 2400 px, with an original and result comparison slider
Drag the Compare slider to see the original and the result side by side before you download.

What 100 KB, 50 KB and 20 KB do to a real photo

We ran five real photographs (landscapes, 0.7 to 1.4 MB each) through this tool at three targets, with no longest side set, and measured the downloaded files:

Five photographs compressed to 100 KB, 50 KB and 20 KB: resulting pixel size
PhotoOriginalAt 100 KBAt 50 KBAt 20 KB
Photo 13840 × 2160
1009.1 KB
3840 × 2160
96.6 KB
3264 × 1836
48.5 KB
2117 × 1191
18.9 KB
Photo 23840 × 2400
814.3 KB
3840 × 2400
95.9 KB
3264 × 2040
48.6 KB
2085 × 1303
19.2 KB
Photo 36400 × 4000
1.3 MB
4395 × 2747
97.4 KB
3281 × 2051
48.8 KB
2075 × 1297
19.2 KB
Photo 43839 × 2400
1.0 MB
3839 × 2400
94.5 KB
2732 × 1708
46.2 KB
1469 × 918
19.0 KB
Photo 53840 × 2400
664.1 KB
3840 × 2400
95.3 KB
3264 × 2040
48.2 KB
2067 × 1292
19.1 KB

At 100 KB, 4 of the five kept their full resolution: compression alone was enough. At 50 KB every photo had to become smaller in pixels too, and at 20 KB they ended up around 2,100 px wide, the most detailed one at 1,469 px. Every file came out between 94% and 100% of its target. If your form shows the photo in a small box, set a longest side (800 is plenty) and the 20 KB file will look much cleaner, because the same bytes are spent on fewer pixels.

How to compress an image, step by step

  1. Press Choose an image: JPG, PNG, WebP, iPhone HEIC, GIF, BMP or AVIF. Choosing several switches to the bulk compressor.
  2. Under Target size, press a chip or type your limit in Maximum size (50 KB, 200kb and 1.5 MB all work).
  3. If the portal states a lower limit too, type it in Minimum size (optional).
  4. Under Output options, keep the format or pick JPEG, PNG or WebP, and type a Longest side for small targets.
  5. The result appears by itself (or press Compress image). Check “Ready to upload”, the new size and the dimensions, then press Download. The file is named after the original with “-compressed” added.

If something goes wrong

  • “This image could not be squeezed under 20 KB without becoming unusable.” Set a longest side of 800 px or less, then compress again.
  • “The minimum must be smaller than the maximum.” Swap the two values.
  • “Try a value like 50 KB, 200kb or 1.5 MB.” The size box did not understand the entry; type a number followed by KB or MB.
  • A PNG came back as a JPG. As a PNG it would have had to shrink a lot to fit, so it was saved as JPG at full size instead. Choose PNG under Format to force PNG.
  • “This browser cannot open HEIC photos.” On iPhone choose Settings → Camera → Formats → Most Compatible, or share the photo as JPEG first.
  • “This picture is incomplete or damaged.” Part of the file is missing, often from a download that stopped early. Choose the full original.

Why file size limits are so hard to hit

Almost every upload form states its limit in kilobytes, and almost every image tool gives you a quality percentage. Those two things are not the same, and there is no fixed relationship between them. A photo of a plain wall at 60% quality might be 30 KB; a photo of a forest at the same 60% might be 400 KB. Quality controls how much detail the encoder throws away, not how many bytes come out the other end.

That is why the usual routine is so frustrating: export, check the size, it is too big, drag the slider down, export again, now it is 8 KB and unrecognisable, drag it back up, and so on. You are performing a manual binary search, badly.

This tool does that search properly. It encodes your image repeatedly at different settings, measures the actual bytes each time, and converges on the highest quality that still fits your limit. The result is not just under the target, it is close to it, which is exactly what you want, because every unused kilobyte is detail you gave away for nothing.

The minimum-size trap

Almost nobody expects this one. A number of official portals reject files for being too small, on the reasoning that a tiny file means a poor scan:

  • US online passport renewal refuses anything under 54 KB.
  • China's COVA visa system requires 40–120 KB, a window, not a ceiling.
  • Indian recruitment boards (SSC, IBPS, RRB) typically want photos at 20–50 KB and signatures at 10–20 KB.

If you have been compressing as hard as possible to be safe, you may have been failing for the opposite reason to the one you assumed. Set a minimum size in the tool above and the output will land inside the window.

When an image is small and simple enough that it compresses below the floor even at maximum quality, we close the gap by adding a metadata comment block to the file. Every decoder skips those blocks, so the picture is byte-for-byte unchanged, the container just becomes the size the portal expects.

Crop and resize before you compress

This is the single biggest improvement available, and most people skip it. Compression works by discarding detail, so the more pixels you ask it to fit into a fixed budget, the more it has to discard from each one.

The measurements above show it: at 20 KB a 4K photo is already cut to about half its width, and the tool still has to compress hard. Start from 600 to 800 px and the same 20 KB keeps far more detail where it is seen.

Set a longest side in the options above, or use the resize tool first if you need exact dimensions. For a photo that will be displayed in a small box on a government form, anything beyond about 800 px is wasted.

Choosing a format

The format matters more than most compression settings, because JPEG and PNG solve fundamentally different problems.

  • JPEG, use for photographs and anything with people or natural scenes. It has a quality dial, so it can be tuned to hit a target. Almost every official portal expects JPEG.
  • PNG, lossless, so there is no quality dial and the only way to shrink it is to reduce dimensions. Correct for screenshots, logos, line drawings and anything needing transparency; a poor choice for a passport photo with a tight size limit.
  • WebP, noticeably smaller than JPEG at the same visual quality, and excellent for websites. Do not use it for official uploads; most portals will not accept it.

If a form says "JPG only" and your file came off an iPhone, it is probably HEIC rather than JPEG even if it looks like a photo. Use the format converter to check and convert.

What compression removes besides detail

Because the image is redrawn from its pixels, the output carries no EXIF metadata. In practice that means the GPS coordinates, camera model, and timestamp embedded by your phone are all dropped. For anything you are sending to a third party, that is a privacy improvement rather than a loss, a photo taken at home usually has your home address written into it.

The one piece of metadata we deliberately write back is print resolution (DPI), and only when a spec calls for it, because a photo sized in millimetres is meaningless without it.

A practical routine

  1. Find the exact requirement, dimensions, format, and both size limits if there are two.
  2. Crop to the required shape first, so nothing important is lost later.
  3. Resize to the required pixel dimensions, or cap the longest side if none are specified.
  4. Compress to just under the maximum, with the minimum set if the portal has one.
  5. Check the downloaded file before uploading, the size is shown in your file manager.

If your requirement is a common one, the requirements database already has the exact numbers and will apply all of them in a single step.

Frequently asked questions

How do I compress a photo to 50 KB?

Choose the photo, press the 50 KB chip (or type 50 KB in Maximum size) and download the result. The tool searches for the best quality that stays under 50,000 bytes, and makes the picture smaller in pixels only if compression alone cannot fit. A 481.8 KB, 1800 × 2400 portrait came out at 48.8 KB with every pixel kept.

How do I compress a photo to 20 KB without it looking bad?

Give it fewer pixels to fit. Type a longest side such as 800 in “Longest side (optional)” before compressing: at 20 KB a photo has to lose detail somewhere, and a smaller picture loses far less per pixel. Exam photos are usually only a few hundred pixels wide anyway.

Is 50 KB counted as 50,000 or 51,200 bytes?

Portals differ, so the maximum is taken as 1 KB = 1,000 bytes (the stricter reading) and a minimum as 1 KB = 1,024 bytes. A file made for “under 50 KB” is at most 50,000 bytes, which passes either way.

How does this hit an exact file size when other tools only have a quality slider?

File size is not a simple function of quality, so a slider can only guess. This tool encodes your image several times at different settings and searches for the largest file that still fits under your limit, usually landing within a few percent of the target rather than far below it.

Why would a form reject a file for being too small?

Some portals set a minimum as well as a maximum, because a very small file usually means a low-quality scan. US online passport renewal rejects anything under 54 KB, and China's COVA visa system wants 40–120 KB. Set a minimum size here and the file will be brought up to it.

Are my photos uploaded anywhere?

No. All processing happens inside your browser using the standard canvas API. Your image is not uploaded to our servers, which is why there is no queue and why the tool keeps working if your connection drops. Images up to 300 MB are accepted.

My photo looks blocky after compressing to 20 KB. What can I do?

Reduce the dimensions first. A 12-megapixel photo squeezed into 20 KB has to throw away almost everything. Set the longest side to around 600 px, then compress, the result at the same file size will look dramatically better.

Can I compress a PNG to a small size?

PNG is lossless, so it cannot be tuned the way JPEG can, the only lever is dimensions. If you need a small file and the image is a photograph, switch the output format to JPEG. Keep PNG only when you need transparency or the image is a screenshot or line drawing.

Does compressing remove EXIF data like location?

Yes. The image is redrawn from its pixels, so camera metadata including GPS coordinates is not carried through to the output. That is usually what you want when sending a photo to a form.

Is the Compress image free?

Yes. The Compress image on The Daily Toolbox is free to use as often as you like, with no watermark and no file limit beyond what your device can handle.

Do I need to sign up or install anything?

No. It works in your web browser on a phone or computer, with no account and nothing to install. You can add the site to your home screen to open it like an app.

Requirements this tool handles