All Tools View Categories Blog About Contact Privacy
✦ CompressPrivate
Compress Anything.
Images · PDF · Video · Audio · Docs
🔒 100% Private ⚡ Free Forever ☁️ No Uploads
Compress Free →

Compress PNG Online

Shrink PNG files up to 70% using color quantization (like TinyPNG) — preserve transparency, convert to WebP, batch process — 100% private, zero upload.

100% private — images processed locally in your browser, never uploaded. Loading…
Drop images here
PNG — drop unlimited images
No images yet
Drop files above to get started
Global Settings
Balanced
Low (high quality)High (small file)
Good balance — recommended for photos
Max Width (px)
Max Height (px)
Aspect ratio always preserved. 0 = keep original dimension.
Complete PNG Format Guide

Everything You Need to Know About PNG Files

PNG is lossless by design, which is exactly why so many PNGs are enormous. The trick to shrinking one is not throwing away pixels — it is throwing away colors nobody can distinguish. Here is how PNG stores an image, why quantization works, and when PNG is the wrong choice entirely.

1996
Specification released
DEFLATE
Compression engine
~70%
Savings via quantization
48-bit
Max color depth

The Portable Network Graphics Format Explained

PNG was created in 1996 as a patent-free replacement for GIF. It compresses losslessly with DEFLATE, supports true 8-bit alpha transparency, and reconstructs every original pixel exactly — which is both its greatest strength and the reason PNG photos are so large.

💎

Perfectly Lossless

Decode a PNG and you get back the exact bytes that went in. Save it a thousand times and nothing degrades. For screenshots, diagrams and design assets that matters enormously.

🌑

Real Alpha Transparency

Unlike GIF's single transparent index, PNG stores 256 levels of opacity per pixel. Soft shadows, anti-aliased edges and glass effects composite cleanly over any background.

📈

Filters Before Compression

Each scanline is pre-processed with one of five filters (None, Sub, Up, Average, Paeth) that predict a pixel from its neighbours. Encoding small differences instead of raw values makes DEFLATE far more effective.

🎨

Great on Flat Color

Large uniform regions and repeated patterns compress spectacularly. A 1920×1080 UI screenshot can be under 100 KB; the same-size photograph will be several megabytes.

📷

Poor on Photographs

Photographic noise defeats prediction — every pixel differs slightly from its neighbour, so nothing compresses. A photo saved as PNG is typically 3–6× the size of a good JPEG at equivalent perceived quality.

🚫

No Animation (Mostly)

Standard PNG is single-frame. APNG adds animation and is supported in all modern browsers, but it is a separate extension and most PNG tooling ignores it.

Why your PNG is 4 MB: A 24-bit PNG stores three bytes per pixel before compression. If the image is photographic, DEFLATE finds almost no repetition and the file stays close to raw size. The fix is not a better zip level — it is reducing the number of distinct colors, or switching format entirely.

PNG Binary File Structure

A PNG is an 8-byte signature followed by a stream of self-describing chunks. Each chunk carries a length, a four-letter type, its data, and a CRC32 checksum — so a decoder can safely skip any chunk it does not recognise.

0x00
8B
Signature
89 50 4E 47 0D 0A 1A 0A
0x08
25B
IHDR — Image Header
width, height, depth, color type
var
var
PLTE — Palette
up to 256 RGB entries
var
var
tRNS — Transparency
per-palette-entry alpha
var
var
iCCP / gAMA / sRGB
color management, often removable
var
var
tEXt / iTXt — Text metadata
editor names, comments
var
…
IDAT — Compressed pixels
filtered scanlines, DEFLATE
end
12B
IEND — End marker
zero-length terminator
Color typeChannelsBytes/pixelAlphaTypical use
0 — Grayscale11NoScans, masks, depth maps
2 — Truecolor33NoPhotos, gradients
3 — Indexed11via tRNSSmallest — icons, UI, logos
4 — Gray + alpha22YesSoft masks
6 — Truecolor + alpha44YesLargest — the default export

Color type is the biggest lever. Most design tools export color type 6 — four bytes per pixel — even for a flat two-color logo. Converting that same image to indexed color (type 3) drops it to one byte per pixel before compression even starts, which is precisely what quantization does.

How Lossy PNG Compression Works

PNG has no quality slider in the format itself. Tools like TinyPNG, pngquant and this one get large reductions by reducing the color count before the lossless encoder runs — a lossy pre-step wrapped in a lossless container.

Step 1
RGBA
Analyse the color histogram
count every distinct pixel value
Step 2
N
Pick an optimal palette
median-cut / octree, 2–256 colors
Step 3
≈
Map pixels + dither
error diffusion hides banding
Step 4
zip
Re-encode as indexed PNG
1 byte/pixel, still lossless from here
🎨

Why It Works So Well

Most real interfaces, icons and illustrations use only a few hundred distinct colors. Reducing 16.7 million possible values to 256 well-chosen ones is invisible on that content and cuts the data to a quarter.

🌬

Dithering

Gradients quantized without dithering show visible banding. Error-diffusion dithering scatters the rounding error into neighbouring pixels, trading a little noise for smooth-looking transitions.

🌑

Transparency Survives

The tRNS chunk stores an alpha value per palette entry, so anti-aliased edges and soft shadows keep their translucency through quantization. Your logo will not gain a white box.

📉

Where It Fails

Photographs and rich gradients genuinely need thousands of colors. Quantize those hard and you get posterised sky and blotchy skin. For photographic PNGs, convert to JPEG or WebP instead.

What to expect: UI screenshots and flat illustrations routinely drop 60–80% with no visible change. Logos and icons often drop over 85%. Photographs saved as PNG typically drop only 10–30% before artifacts appear — that is the signal to switch output format rather than push the level higher.

PNG vs JPEG vs WebP vs GIF

PNG is the right answer for a narrower set of images than most people assume. Here is how it compares on the dimensions that decide the choice.

PropertyPNGJPEGWebPGIF
CompressionLossless DEFLATELossy DCTLossy + losslessLossless LZW
Colors16.7M (+ alpha)16.7M16.7M (+ alpha)256 max
Transparency8-bit alphaNone8-bit alpha1-bit only
Photo (3MP)~4–6 MB~0.5–1 MB~0.4–0.8 MB~2 MB, posterised
UI screenshot~80–300 KB~200 KB, fringed~60–220 KB~250 KB
Sharp text/edgesPerfectRingingPerfect (lossless)Perfect
AnimationAPNG onlyNoYesYes
Browser supportUniversalUniversalAll modern browsersUniversal

Rule of thumb: keep PNG for screenshots, logos, icons, diagrams and anything with transparency or crisp text. Switch to JPEG for photographs with no transparency. Choose WebP when the image is web-facing — it wins on both categories, lossless for graphics and lossy for photos.

PNG Compression Strategies That Actually Work

Six things that reliably shrink a PNG, roughly in order of how much they save.

1

Check whether the image should be PNG at all. If it is a photograph with no transparency, converting to JPEG or WebP will beat any PNG optimisation by an order of magnitude. PNG earns its place on flat color, sharp edges and alpha.

2

Resize to the real display size first. A 3000px-wide PNG shown in a 600px column is wasting 96% of its pixels. Set the max width to the largest size it is ever rendered at (double it for retina, no more).

3

Push the compress level until you see banding, then back off. Flat UI art often survives level 70–85 untouched. Gradients start to band earlier — watch smooth sky-like areas in the split preview and stop one step before it shows.

4

Strip metadata. Editor text chunks, timestamps and embedded ICC profiles can add 50–700 KB to a file exported from a design tool. Removing them changes nothing visible on the web, where sRGB is assumed anyway.

5

Crop transparent padding. Fully transparent margins still cost bytes and still count as pixels. Trimming an icon's empty border can cut both dimensions by a third.

6

Try WebP lossless for the same image. WebP's lossless mode typically beats optimised PNG by another 20–30% on the exact same graphic, with identical pixels and full alpha. Compare both outputs before you publish.

Everything runs locally. Quantization, resizing and re-encoding all happen in your browser using the Canvas API — your PNGs are never uploaded, which makes this safe for internal screenshots, product mockups and unreleased design work.

About Compress PNG Online

Compress PNG files in your browser — no upload, no server, complete privacy. Compress PNG Online uses color quantization (the same technique as TinyPNG) powered by UPNG.js to reduce PNG file size up to 70%, while preserving transparency and visual quality at typical viewing sizes.

PNG is a lossless format — the standard canvas quality parameter has no effect on PNG output. Real PNG compression requires color quantization: reducing the palette from millions of unique colors to a smaller indexed set (256 or fewer). At compress level 25, the palette is reduced to ~180 colors; at level 50, to ~100 colors; at level 80, to ~30 colors. The result is a smaller indexed PNG that is nearly indistinguishable from the original at normal zoom levels.

Convert PNGs to WebP for 50% additional savings over compressed PNG, with full alpha channel support. Use the resize fields to cap output dimensions — halving width and height reduces file size by ~75% before any quantization. Strip EXIF metadata to remove embedded data that inflates file size. Batch process any number of PNGs with a single click.

Features

  • Color quantization compression — UPNG.js palette reduction (like TinyPNG), 40–70% savings on typical PNGs
  • Transparency preserved — alpha channel maintained through quantization and WebP conversion
  • Convert PNG to WebP — 50% better compression than PNG at same visual quality, alpha supported
  • 100% browser-local — UPNG.js + Canvas API compression, no upload, works offline, files never leave device
  • Unlimited batch processing — compress entire PNG libraries at once with real-time per-file progress
  • Smart resize — Max Width/Height with aspect-ratio lock; pairs with quantization for maximum savings
  • Before/After split viewer — drag to compare original vs compressed quality side by side
  • Batch ZIP download — download all compressed PNGs in one archive
  • Automatic size guard — if compression inflates a file, the original is kept automatically

How to Use

  1. Drop PNG files. Drag PNG files onto the drop zone or click Browse. Any number accepted.
  2. Choose output format. PNG (default) for transparency and lossless quantization. WebP for 50% better compression.
  3. Set compress level. Level 25–50 is recommended — significant savings with minimal visible change.
  4. Optional: resize. Set Max Width or Max Height to cap output dimensions. Aspect ratio is always preserved.
  5. Compress All. All files are quantized with your settings. Real-time progress bar shows status.
  6. Download. Individual file downloads or ZIP archive for the full batch.

Examples

Example 1 — Web graphics optimization: 30 UI screenshots (avg 800 KB each) → PNG output, compress level 40 → avg 250 KB each → 69% savings → download ZIP → deploy to website.

Example 2 — Logo and icon batch: 20 PNG logos with transparency → PNG output, compress level 25 → avg 60% savings, transparency intact → download ZIP.

Example 3 — Maximum size reduction: Large PNG photos → WebP output, compress level 35 → avg 85% savings vs original PNG → ideal for web page performance.

Benefits

  • TinyPNG-equivalent results, locally — the same color quantization algorithm TinyPNG uses, running entirely in your browser with no uploads and no usage limits.
  • Transparency safe — unlike JPEG conversion, PNG and WebP output both fully preserve alpha channels, making this safe for logos, UI graphics, and assets with transparent backgrounds.
  • Complete privacy — TinyPNG and similar services upload your files to their servers. This tool processes everything locally — your PNG files never leave your device.

Frequently Asked Questions

How much can I compress a PNG file?
PNG compression uses color quantization — reducing the number of unique colors in the image — to achieve real size reduction. At compress level 25–50, typical PNG files shrink 40–70% with minimal visible change. Screenshots and graphics with flat colors compress the most (60–80%). Photos saved as PNG have more unique colors and typically compress 30–50%. Converting to WebP gives an additional 50% savings over PNG at equivalent quality.
Does PNG compression affect transparency?
No — transparency (alpha channel) is fully preserved during PNG-to-PNG compression. The color quantization algorithm used (UPNG.js, same approach as TinyPNG) maintains alpha data through the process. Transparency is also preserved when converting PNG to WebP — WebP natively supports alpha channels. Only converting to JPEG loses transparency, since JPEG does not support alpha.
What is color quantization and how does it compress PNG?
PNG is a lossless format — canvas.toBlob ignores the quality parameter for PNG. Real PNG compression requires color quantization: reducing the color palette from millions of unique colors to a smaller set (e.g. 256 or fewer). This is how TinyPNG works. This tool uses UPNG.js to perform the same quantization in your browser, mapping similar colors to a shared palette entry. The result is a smaller indexed PNG that looks nearly identical to the original at typical viewing sizes.
What is the difference between PNG and WebP compression?
PNG with color quantization can achieve 40–70% savings while remaining lossless in terms of visual information. WebP uses a completely different codec that handles photographic and gradient content much more efficiently — WebP at the same visual quality is typically 50% smaller than PNG. If you need transparency and maximum compatibility (older software, email), use PNG. For web images where modern browser support is available, WebP gives the best compression.
Can I convert PNG to WebP for better compression?
Yes — select WebP as the output format. WebP output is typically 50% smaller than the equivalent PNG at the same visual quality. Transparency is fully preserved in WebP output (WebP supports alpha channels). All modern browsers support WebP (Chrome, Firefox, Edge, Safari 14+). The compress level slider controls WebP quality — lower levels give near-lossless output, higher levels maximize compression.
Why is the 'PNG lossless · kept original' message showing?
This message appears when the compressed PNG is larger than the original — which can happen at very low compress levels (1–5) where quantization is minimal and PNG re-encoding overhead exceeds savings. In this case the tool automatically keeps the original file instead of inflating it. Try compress level 15–40 for meaningful PNG savings. For files where PNG compression consistently shows no gain, converting to WebP is the most effective option.
Can I resize PNG images while compressing?
Yes — use the Max Width and Max Height fields. Enter a pixel limit (e.g. Max Width: 1200) and the image is scaled down proportionally if it exceeds that dimension. Aspect ratio is always preserved. Resize combined with quantization is the most effective approach — halving the dimensions reduces file size by approximately 75% before any quality compression is applied.
Is my data private when using this tool?
Completely private. All PNG compression happens in your browser using UPNG.js (color quantization) and the native Canvas API. No image data is sent to any server. The tool works offline after the initial page load (except for loading UPNG.js and JSZip). Your files never leave your device — unlike TinyPNG and similar services that upload your images to a remote server for processing.

More Image tools

View All