Skip to content

Compress a PNG to a file size

Image

or drop it here

Mode
More options

Your new image will appear here

Choose an image above, or drop it on the box.

Compared with the original
—
Pixel size
—

PNG has no quality dial, so a screenshot or diagram that must stay PNG gets smaller only by losing pixels. This page keeps the PNG format and scales the picture down until it fits under your KB limit.

Worked example

Mode
To a file size
Quality
75
Largest file size
5
Unit
KB
Save as
PNG

Result Compressed size: 4.3 KB
Compared with the original: 39% smaller
Pixel size: 229 × 41 px

  1. Opened 900 × 160 px, 7.1 KB
  2. Target: 5 KB = 5,120 bytes (1 KB = 1,024 bytes)
  3. Quality alone was not enough, so the pixel size was reduced to 229 × 41 px
  4. Saved as PNG, 4.3 KB

How to use it

  1. Choose the image

    Press Choose image or drop a JPG, PNG, WebP or GIF file of up to 25 MB on the box.

  2. Pick a mode

    By quality uses the slider. To a file size takes a number with KB or MB beside it, such as 200 KB for a form limit.

  3. Check and download

    Read the new size and the percentage saved, look at the preview, then download. Under More options you can force JPG, WebP or PNG.

How it is calculated

chosen quality = the highest q in 5–95% where encoded size(q) ≤ limit; limit in bytes = KB × 1,024 or MB × 1,048,576

q
the JPEG or WebP quality passed to the browser encoder
limit
the largest file size you typed, in bytes

The browser decodes the picture, turns it upright from its EXIF orientation tag and redraws it on a canvas. In To a file size mode it first saves at 5% quality. If that already fits, a halving search over six more saves narrows down the best quality under the limit. If even 5% is too large, the width and height are cut by about the square root of the size ratio and the search repeats. PNG output is lossless, so only the scaling step applies to it.

Sources

When not to use it

  • For print files that need a set DPI, CMYK colour or untouched camera data.
  • To keep an animated GIF moving; only the first frame is saved.
  • For a PDF; this compressor reads picture files only.

Common mistakes

  • Forcing PNG for a photo, which usually makes the file bigger than the JPG it came from.
  • Compressing an already compressed JPG again and again; each save at low quality adds more blocky artefacts.
  • Treating 1 MB as 1,000 KB; this tool counts 1 MB as 1,024 KB, the way most web forms do.