How to compress an image to a specific file size

  1. Drop an image onto the box, or click it to choose a file. JPEG, PNG, WebP, GIF, BMP and AVIF files work in most browsers, and iPhone HEIC photos are converted automatically.
  2. Pick a target size: 20 KB, 50 KB, 100 KB, 200 KB, 500 KB, 1 MB or 2 MB, or type any value in KB or MB.
  3. Choose JPEG for the widest compatibility, or WebP for smaller files at similar quality. Almost every upload form accepts JPEG.
  4. The tool tries different settings until the file is at or just under your target, then shows the final size, dimensions and quality. Download the result.

If the image is already smaller than your target, the tool tells you so and does not recompress it. Lowering the target compresses it further.

Why websites ask for a maximum file size

Application portals, exam registrations, visa and identity forms, HR systems and email gateways often cap uploads at a small size, commonly somewhere between 20 KB and 2 MB. A modern phone photo is several megabytes, so it is rejected until it is made smaller. Limits are usually checked on the file itself, not on how big the picture looks, which is why a photo that appears fine on screen can still fail.

How the tool reaches the target

File size depends on two things: image dimensions and compression quality. The tool changes them in this order:

  • Quality first. It starts near 92% quality and uses a binary search to find the highest quality that still fits your target. This keeps the picture as sharp as possible at its original dimensions.
  • Dimensions only if needed. When even moderate quality leaves the file too big, and Allow reducing dimensions is ticked, the image is scaled down just enough to fit while quality stays reasonable.
  • Last resort. At the smallest allowed dimensions the tool lets quality drop further. If the target still cannot be met, it says so and shows the smallest file it managed instead of pretending it worked.

If you must keep exact pixel dimensions, for example a form that requires 200×230 pixels, untick the dimension option. Quality will then be pushed lower to meet the limit, and very small targets on large images may not be reachable. Resize the image to the required dimensions first, then compress it.

Kilobytes: 1,000 or 1,024?

Operating systems and websites disagree. Some count 1 KB as 1,000 bytes and others as 1,024 bytes. This tool uses 1,000 bytes, so a file compressed for a 50 KB limit is at most 50,000 bytes and stays under the limit however a site counts. The result is shown in bytes as well, so you can check it against what your form says.

JPEG, WebP and PNG

  • JPEG is the safest choice for photos, signatures and ID pictures. It has no transparency, so transparent areas are filled with white.
  • WebP usually makes a smaller file at the same visual quality and keeps transparency. Some older forms and software do not accept it, so check before uploading.
  • PNG files are lossless, so their size cannot be tuned with a quality setting. Choosing JPEG or WebP here converts a PNG to a format that can reach small targets. Screenshots with text may look slightly softer after conversion.

Tips for very small targets

  • Targets under about 30 KB work best on images that are already small in pixel size, such as a passport-style photo or a signature. A 12-megapixel photo squeezed into 20 KB has to lose a lot of detail.
  • Crop away empty space before compressing. Fewer pixels means a smaller file at the same quality.
  • Photographs of paper signatures compress better on a plain white background with dark ink.
  • After compressing, open the result and check that faces, text and signatures are still readable before you upload it.

Privacy

The image, including HEIC photos from an iPhone, is decoded and re-encoded entirely inside your browser using the canvas feature built into it. The file is not uploaded to QuickToolsBox or any other server, so it also works for private documents. Close the page and nothing is kept.

Troubleshooting

  • The result is still too large. Increase the target, allow dimension reduction, or crop the image first.
  • The picture looks blurry. The target is too small for the image. Try the next size up.
  • WebP is greyed out. Your browser cannot create WebP files. Use JPEG.
  • A photo looks rotated. Most phone photos carry an orientation flag that modern browsers respect. If the output appears sideways, rotate the original and try again.
  • An iPhone photo takes a few seconds to start. HEIC photos are converted to JPEG inside your browser before compressing. This happens once, and large photos can take several seconds.
  • The file will not open. If a HEIC photo or another format fails, export it as JPEG from your Photos app or phone's share menu, then use it here.