100% in your browser · No uploads🇪🇺 GDPR friendly⚡ Instant · No signup

Compress an image to 5 MB

Shrink large JPG, PNG, WebP or HEIC files to under 5 MB privately in your browser.

Drop a photo here, or tap to choose

JPG · PNG · WEBP · HEIC — files never leave your browser

0 photos uploaded — ever.
All processing happens locally in your browser.

5 MB is a common ceiling for Gmail attachments, print-on-demand uploads and some document portals. The tool keeps your original pixel size when possible and only drops encoder quality enough to fit under 5 MB.

What needs a 5 MB photo?

5 MB is rarely a hard upload cap — it's more often the limit beyond which an email server starts rejecting attachments. Compressing a multi-megapixel camera RAW export to 5 MB keeps it shareable without visible quality loss.

How the compressor hits 5 MB

We binary-search the JPEG quality between 0.40 and 0.95 to find the highest setting whose encoded output fits under 5 MB. For most photos at typical document dimensions this lands within 1.5 KB of the target after 6–8 iterations. If quality 0.40 still overshoots, we progressively scale the canvas down by 10% and try again — the editor only ever reduces resolution as a last resort.

What if the output is still too big?

  • Reduce pixel dimensions. A 600×600 photo can never shrink to 5 MB as far as a 413×531 one can. Switch the size mode to a passport preset, or set custom pixel dimensions.
  • Switch format to WebP. WebP typically gives 25–35% smaller files at equivalent quality. Some upload portals reject it, so check the spec page first.
  • Crop tighter. Less background means less detail to encode, which lets the encoder use more bits on the face.

How to use this page

  1. Drop your JPG, PNG, WebP or HEIC photo above.
  2. Pick a size preset (passport, square avatar, custom pixels) — or leave it on "Free" to keep the original dimensions.
  3. The target is already set to 5 MB. Click Generate and download.

Privacy

Every step happens inside the browser tab you have open. Your image is decoded, cropped and re-encoded by the same JavaScript engine that runs this page — there is no upload, no temporary file on a server, and no "processed copy" cached by us afterwards. When you close the tab, the blob is gone. We document the full pipeline on our Methodology and How it works pages.

FAQ

When do I need a 5 MB limit?

Email attachments, content management systems, and image gallery uploads commonly cap each file around this size.

Will the photo still look sharp?

Yes — at 5 MB the output is virtually indistinguishable from the source, even on retina displays.

Why would I need 5 MB if smaller is better?

Some print platforms, print-on-demand services and document portals require high-fidelity images and accept up to 5 MB per file.

Is the file uploaded?

No. Everything runs in your browser. Close the tab and the file is gone.

Does compressing to 5 MB blur the photo?

For a 413×531 px passport photo at 5 MB, the output is visually indistinguishable from the original on a phone or laptop screen. Below ~30 KB at the same dimensions you start to see mild softening; below ~15 KB JPEG block artifacts become visible.

Will the file be exactly under 5 MB?

The compressor stops the search at the first quality that fits, so the output is guaranteed to be ≤ 5 MB. You'll usually land 1–5 KB under the limit.

What happens to my image after I close the tab?

It is freed from your browser's memory like any other image you opened. We never received it, so we have nothing to delete on our side. See Trust & Safety for the full policy.

Related tools