Compress image to ⁨5 MB⁩

Drop your images here

or click to browse files
JPGPNGWEBPAVIF
Max file size: ⁨100 MB⁩•Multiple files supported
Support Us 💚Help keep ToolZool free
IMG / 01 · exact-size compression

Drop in a photo. ToolZool finds the best-looking file that still fits under ⁨5 MB⁩, without the image leaving your device.

How to compress an image to 5 MB

  1. Choose your image, or drop it on the tool. Nothing uploads, so file size costs you no waiting.
  2. Check the target. It is set to 5 MB on this page; use a preset or the custom field to change it.
  3. Leave the strategy on Auto so quality is tried first and dimensions only drop if that is not enough.
  4. Press Compress to 5 MB. You get the largest file that still fits, which is the best-looking one.
  5. Download. Aspect ratio is preserved and camera metadata is removed.

What 5 MB realistically holds

A file size limit means different things depending on what is in the picture. A flat logo and a detailed landscape both have to fit in the same number of bytes, and only one of them has detail to spare.

Image typeAt ⁨5 MB⁩
Passport-style headshot, 600 px wideEffectively lossless
Screenshot of text or UIComfortable at full resolution
Detailed landscape photo, full widthComfortable — good quality retained
Flat logo or iconVery comfortable

Guidance from typical JPEG behaviour, not measured benchmarks. Published test data is on the roadmap.

Other exact targets

How it works

Hitting an exact size is a search problem, not a taste problem. A quality slider makes you guess, re-export, check the file size and guess again.

ToolZool does the search instead. It decodes your image, then repeatedly re-encodes it while narrowing in on the highest quality setting that still lands under your target — keeping the largest file that fits, because that is the best-looking one. If even the lowest useful quality stays above the target, it reduces the dimensions a step and searches again.

All of that happens inside your browser tab. The processing core is written in Rust and compiled to WebAssembly, and it runs in a background worker so the page keeps responding while it works — you can watch which quality level it is trying, and stop it. The engine is only downloaded once you actually pick a file, so reading this page costs nothing.

Before any of that, the image is turned upright. Phone cameras record the sensor’s own orientation plus a rotation tag; software that ignores the tag produces sideways photos. The rotation is applied to the pixels first, which is also why the result carries no camera, timestamp or GPS metadata — there is nothing left for it to travel in.

Why compress in the browser

  • Nothing is uploaded. There is no server copy to be stored, leaked or subpoenaed, because the file never travels over the network.
  • No waiting on a queue. A 40 MB camera file costs no upload time. The work starts immediately.
  • Metadata goes away. Re-encoding from raw pixels drops camera model, timestamp and GPS location. Orientation is applied first, so the result is not rotated.
  • It works on a bad connection. Once the page has loaded, the tool runs without the network.
  • No account, no watermark, no daily limit.

Supported formats

In: JPG, PNG and WebP. The file’s own bytes decide — renaming a PNG to .jpg changes nothing, because the tool reads the format signature rather than the filename.

Out: JPEG, PNG, or WebP in its lossless mode.

FormatReadsWritesKeeps transparency
JPEGyesyes, quality-searchedno — transparent areas are filled
PNGyesyes, losslessyes
WebPyeslossless onlyyes
AVIFnono—
HEICnono—

Pick JPEG for photographs. It is the only output with a quality dial, so it is the only one that can hit an arbitrary small target on a photograph.

Pick PNG or WebP for screenshots, logos and diagrams. Lossy compression puts visible fringing around hard edges, and on flat colour it often produces a larger file than lossless would. Lossless WebP is normally the smaller of the two: on the 2400 × 1800 photograph used to verify this tool it came out 7.6 MB against PNG’s 9.7 MB, about 22% smaller. The gap varies with the picture, so if the exact number matters, run both and compare.

Because the lossless formats keep every pixel exactly, the only lever they have against a size target is dimensions. If a 50 KB target matters more than exactness, JPEG is the honest choice.

AVIF and HEIC are not supported. Both need an AV1 or HEVC decoder, and every maintained option is a C library that does not build for WebAssembly — so rather than half-support them, the tool says so and points you at converting first.

Exact target size in KB or MB
Automatic quality search — the largest file that still fits
Dimension reduction when quality alone is not enough
Optional maximum width and height, aspect ratio preserved
JPEG, PNG or lossless WebP output
Transparency preserved, or composited over a colour you choose
EXIF orientation applied, so phone photos are never sideways
Camera, timestamp and GPS metadata removed
Several images in one go, downloadable as one ZIP
Processed on your device — no upload

FAQ

Will the image lose visible quality?

Some, unavoidably, if the original is far above the target. ToolZool minimises it by finding the highest quality that still fits, and reducing dimensions only when quality alone cannot get there.

Which formats can I put in?

JPG, PNG and WebP. AVIF and HEIC are not supported yet — every maintained AV1 decoder is a C library that does not compile to WebAssembly, so we would rather say so than half-support them. Output is JPEG, PNG or lossless WebP.

Is there a file size limit?

100 MB per file. There is no resolution limit: a 100- or 200-megapixel camera photo is brought down to a workable size first — you will see 'Zooly is preparing your image safely' while that happens — and then compressed normally. The byte limit exists because the work happens in your browser tab, on your device's memory, rather than on a server with a quota.

Why is there no lossy WebP option?

There is no lossy WebP encoder we can ship. The maintained pure-Rust one is licensed AGPL, which is incompatible with this site, and every other option needs a C toolchain that does not build for WebAssembly. Offering a WebP setting that quietly produced lossless output and then missed every small target would be worse than leaving it out. For photographs, JPEG gets closer to a small target than any lossless format can.

Is EXIF and location data removed?

Yes. Re-encoding drops camera, timestamp and GPS metadata. Orientation is applied to the pixels first, so the image does not come out rotated.

Did this tool do the job?
One tap. It only records the answer, never your file.
Reviews of this tool

We publish reviews per tool as they arrive, unedited. Nothing here is invented or paid for.

Related tools

Thanks to you,
ToolZool stays free

Powerful tools should be free for everyone. Here is how that is paid for — all of it, with nothing left off the list.

Buy Zooly a coffeeDirect support that keeps the lights on and new tools coming. Entirely optional.Support Zooly →
Recommended picksPaid tools that finish jobs a browser cannot. Nothing on that page earns us anything today.See recommendations →
Ads, kept respectfulLabelled placements sit outside the working area, so they never come between you and your result.Read the ad policy →
You are awesomeEvery visit, share and kind word helps ToolZool grow and reach more people.