Skip to main content

How to Compress a Photo to a Target File Size

General technical information — not specific to any government document requirement

Most upload forms that reject a photo for being "too large" are checking file size in kilobytes, not pixel dimensions. Here's what actually controls that number, and how to bring it down without the photo looking obviously degraded.

Quality vs. file size

JPEG and WEBP are lossy formats: they store an approximation of the image, and a "quality" setting controls how close that approximation is. Lower quality means more approximation, smaller files, and eventually visible blockiness or blurring — especially around sharp edges and text. There is no single "correct" quality percentage; it depends on the photo and the target size. Because of this, a reliable way to hit an exact target size is to search for the highest quality that still fits, rather than guessing a fixed percentage.

PNG is different

PNG is lossless — it has no quality setting, so a PNG's file size is determined purely by the image's content and dimensions, not a quality knob. A PNG of a photo is usually much larger than an equivalent JPEG. If a form specifically requires PNG, resizing to smaller dimensions is the main lever available for reducing file size.

When to resize instead of just compressing

A photo straight from a modern phone camera is often several megabytes at very large pixel dimensions — far larger than any upload form needs. Reducing the pixel dimensions to something reasonable for the form (a passport photo digital spec is typically under 2000px on a side) usually gets most of the way to a small file size on its own, before compression quality even needs to drop very far. Compressing a huge, full-resolution photo down to a tiny target size usually needs much lower quality — and looks worse — than compressing an already-appropriately-sized photo to the same target.

Picking a target

  • Follow the exact limit stated by whatever form or authority you're submitting to, if one is given.
  • If no limit is stated, 100–300KB is comfortably small for most web/application forms without heavy visible quality loss on a reasonably sized photo.
  • For print, prioritize resolution (pixel dimensions/DPI) over file size — most print processes don't have a KB limit.