Optimize PNG

Losslessly optimize and compress PNG images in your browser. Smaller files, identical pixels, free, private, no upload, batch support.

🌐 Español

Drop your files here (.png)

🔒 Private by design: your files are processed locally in your browser and never uploaded to any server.

What oxipng rewrites inside a PNG

A PNG stores its pixels in three layers of decision, and most files exported from a design tool or a screenshot key get all three wrong. First, the bit depth and colour type: a screenshot of a terminal might contain forty distinct colours yet still be stored as 8 bits per channel of full-colour RGBA, using four bytes where one palette index would do. Second, the row filter: PNG lets every single row of the image pick one of five predictors so that the values passed to the compressor are mostly small differences rather than raw colours, and most encoders pick one filter for the whole file or guess with a cheap heuristic. Third, the DEFLATE pass itself, which can be run harder than any exporter bothers to.

oxipng, the Rust optimizer this tool runs, works on all three. It tries the filter combinations, reduces depth and palette wherever the image’s real colour content allows it exactly, and re-deflates the result. What it never does is approximate a colour. That distinction is the whole point: the file gets smaller, the picture does not change.

The optimizer is compiled to WebAssembly and loaded from this site itself, not from a public CDN, and it runs single-threaded because the headers a multi-threaded WebAssembly build needs would break other parts of this page. So it is genuinely your own processor doing the compression work, one file after another.

Optimizing a folder of PNGs

  1. Drop your .png files into the box above, or use Choose files. You can keep adding until the batch looks right; duplicates by name and size are filtered out.
  2. Leave Optimization effort on Balanced (recommended) for a first pass, or raise it if you have time to spend.
  3. Click Optimize PNG. The first click also fetches the WebAssembly optimizer, so expect that run to start a moment later than the rest.
  4. Download each file. The size line above the downloads gives the totals before and after, so you can see whether the effort level was worth raising.

Effort 2, 4 and 6, and what the extra time buys

The three choices map onto oxipng’s own optimization levels: 2, 4 and 6 out of a 0 to 6 scale. Higher levels do not use a different algorithm, they simply try more combinations of filter and compression strategy before settling, so the cost is time and the benefit is a few more bytes.

Balanced is the honest default. The gap between level 2 and level 6 is usually small next to the gap between an unoptimized export and level 2, and level 6 on a large photographic PNG can take a noticeable while on a laptop. Raise it when you are preparing an asset that will be served millions of times, where every kilobyte is multiplied, and leave it alone when you are cleaning up a screenshot for a bug report.

Byte-identical pixels, transparent ones included

Every optimization here is verified lossless by construction rather than by eye. The decoded red, green, blue and alpha value of every pixel is the same before and after, which is why this is safe for a logo, a UI mockup, a chart, a diagram with hairline strokes or an icon with a one-pixel border, all cases where a lossy compressor’s softening would be visible immediately.

Two settings are deliberately forced to protect that guarantee. Alpha optimization, which rewrites the invisible colour data behind fully transparent pixels, is switched off, so even pixels you cannot see keep their exact stored values. Interlacing is switched off too, since it reliably inflates a PNG.

PNGs this will not shrink

Some files come back the same size, and that is a real outcome rather than a failure. A PNG that already went through an optimizer has nothing left to gain, and a very small icon can have so little data that the overhead dominates. When the optimized version is not smaller than the input, the tool returns your original bytes, so you can never end up with a bigger file by running this.

Photographic PNGs are the other disappointing case. PNG compresses runs of similar values, and a photograph has almost none, which is why a camera image saved as PNG is enormous and stays enormous. The fix there is a format change rather than an optimization: PNG to WebP or PNG to AVIF will do far more for that file than any lossless pass. Compress Images keeps the format instead, and its quality box does nothing to a PNG because the browser’s PNG encoder has no quality parameter to hand it to, though the re-encode alone can still come out smaller, and your original bytes come back when it does not and no downscale was applied. If the image is simply larger than it needs to be, Resize Image attacks the pixel count directly. The rest of the toolkit is on the image tools hub, and the image converter and editing tools guide compares the options side by side.

See it in action

Screenshot of the Optimize PNG tool with sysfenix-sample.png (466 KB) loaded, Optimization effort set to Balanced (recommended)
Optimize PNG mid-process: sysfenix-sample.png (466 KB) loaded, Optimization effort set to Balanced (recommended).
Screenshot of the Optimize PNG result screen showing sysfenix-sample.png ready to download (274 KB, 41% smaller)
The finished result: sysfenix-sample.png ready to download (274 KB, 41% smaller). The download link is a local blob URL — the file never leaves your device.

Frequently asked questions

Does this reduce the number of colours in my PNG, like pngquant does?

No, and that is the difference between a lossless optimizer and a lossy one. Palette quantizers such as pngquant shrink a file by mapping thousands of colours down to 256, which changes the picture. oxipng only reduces bit depth or switches to a palette when the image genuinely contains few enough distinct colours for that to be exact, so no colour value is ever approximated.

Why does the download have the same filename as my original?

Because it is the same image, not a converted copy, so there is no meaningful suffix to add. Your browser will normally save it alongside the original with a numbered suffix of its own rather than overwriting anything, but it is worth checking which of the two you then upload.

Does the optimizer touch fully transparent pixels?

No, deliberately. oxipng can rewrite the hidden red, green and blue values behind fully transparent pixels to help compression, which is invisible but does change the stored bytes, so that option is switched off here. Every channel of every pixel, including ones you cannot see, comes out exactly as it went in.

Will the optimized PNG still be interlaced if the original was?

Not when the optimized copy is what comes back, because interlacing is switched off for the run. Adam7 interlacing, the trick that makes a PNG appear in progressively sharper passes while it loads, almost always makes the file bigger, so dropping it is usually most of what makes the optimized copy smaller. In the rare case where the optimized version is not smaller than the input, your original bytes are returned untouched and the interlacing comes back with them. Either way the image itself is unchanged; only its loading behaviour is.

Does the whole optimizer download before the first file?

Yes, once per tab. The oxipng module is a WebAssembly file served from this site rather than a third-party CDN, and it is fetched on the first click and reused for everything afterwards, so the first run has a short pause the later ones do not.

Can I optimize a JPG or a WebP here?

No. This tool only accepts .png, and a file with any other extension is refused before processing starts, because oxipng works on the PNG container's own filters and DEFLATE stream and has nothing to say about a JPEG. Lossy formats are handled by the general compressor instead.

Related tools