Skip to main content

File format

What is a PNG file?

Checked against the sources on Sizes measured

In one paragraph

A PNG (Portable Network Graphics) file stores a raster image losslessly: the pixels you save are the pixels you get back. The W3C defines it; the Third Edition of the specification became a W3C Recommendation on 24 June 2025. PNG holds greyscale, truecolor or palette (indexed-colour) images at 1 to 16 bits per sample, with an optional alpha channel for transparency, and since the Third Edition the same specification also covers animated PNG (APNG).

PNG at a glance

PNG at a glance
PropertyWhat the source saysSource
Media typeimage/png; animated files may use image/apng. The Third Edition defines both, and both are in the IANA registry.W3C PNG 3eIANA
File signatureThe first eight bytes are always 89 50 4E 47 0D 0A 1A 0A (hex).W3C PNG 3e
CompressionLossless. Each scanline is filtered, then the data is compressed with compression method 0 (deflate), the only method the specification defines.W3C PNG 3e
Colour types and bit depthsGreyscale 1, 2, 4, 8 or 16 bits; truecolor 8 or 16; indexed-colour 1, 2, 4 or 8; greyscale with alpha 8 or 16; truecolor with alpha 8 or 16.W3C PNG 3e
TransparencyA full alpha channel (colour types 4 and 6), or a tRNS chunk naming transparent palette entries or one transparent colour.W3C PNG 3e
AnimationAPNG: the acTL, fcTL and fdAT chunks. A decoder that does not know them shows the static image.W3C PNG 3e
Largest imageWidth and height are four-byte integers limited to 2^31 - 1; zero is invalid.W3C PNG 3e
Browser supportMDN lists PNG as supported by all versions of Chrome, Edge, Firefox, Opera and Safari (MDN read on 13 November 2026).MDN
Each row was checked against the linked source on 13 November 2026.

How PNG keeps every pixel

PNG does not throw information away. Before compressing, the encoder runs a filter over each row of pixels. The five filter types in the specification (None, Sub, Up, Average and Paeth) each predict a byte from its neighbours to the left and above, and store only the difference from that prediction. On an image with large areas of one colour those differences are mostly zero, and the deflate step that follows packs long runs of zeros into very few bytes.

The same mechanism explains why PNG struggles with photographs. Sensor noise and fine texture make every pixel slightly different from its neighbours, so the predictions miss, the differences are not zero, and deflate has little repetition to exploit. A PNG of a photo is often many times the size of a JPEG or WebP of the same picture, and the measurement on this page shows by how much for one sample.

Because the filters are reversible and deflate is lossless, decoding returns the exact samples that were stored. Saving a PNG again does not degrade it, which is why PNG is a common working format for images that will be edited more than once.

How to open a PNG file

Drag the file onto any open browser tab. Every current major browser displays PNG, including its transparency and, for APNG, its animation, so a browser is the quickest viewer on a computer that has no image editor installed.

If a file ending in .png refuses to open anywhere, look at its first eight bytes in a hex viewer. A real PNG always starts with 89 50 4E 47 0D 0A 1A 0A; the second to fourth bytes spell "PNG" in ASCII. If the bytes say something else, the file is another format with the wrong extension, or it is damaged. The specification notes that the signature also allows early detection of some transmission errors, so a damaged first few bytes are caught before any pixel is read.

To send a PNG to someone whose software only takes JPEG, convert it in the Image Converter. JPEG has no alpha channel, so transparent areas are filled with a background colour (white by default) during the conversion.

What changed in the Third Edition (2025)

The Third Edition brought three things that had lived outside the core specification into it. Animated PNG, which browsers had supported for years through unofficial chunks, is now defined by the acTL, fcTL and fdAT chunks in the main text. The eXIf chunk, which carries camera metadata, moved in from the PNG extensions document. And the new cICP, mDCV and cLLI chunks let a PNG describe High Dynamic Range and wide colour gamut content and the display it was mastered on.

None of this changes how an ordinary PNG is decoded. An older decoder ignores ancillary chunks it does not understand, so it still shows an APNG's static image and an HDR PNG's pixel data, just without the animation or the extra colour information.

When PNG is the right format

When PNG is the right format
Your imageUse PNG?Why
Screenshot, chart or UI captureYesFlat colour and hard edges are exactly what PNG's filters predict well, and text stays sharp.
Logo or icon that needs a see-through backgroundYesFull 8- or 16-bit alpha per pixel; JPEG has none.
Camera photo for a web pageUsually notLossless storage of noise is large. A lossy format at a sensible quality is far smaller.
Image you will keep editingYesRe-saving costs nothing, so there is no generation loss between edits.
Short looping animationPossiblyAPNG keeps full colour and alpha; check the destination accepts image/apng or .png animations.
Upload form that only lists JPGNoConvert it; the form will reject the extension whatever the quality.

Measured example

PNG sizes for the two samples, encoded by the browser's canvas
FileBytesSizeFidelity to the original
Photo sample as PNG1,275,2251245 KBidentical pixels
Graphic sample as PNG22,71422.2 KB67.2 dB (no pixel off by a whole level)
Photo sample as JPEG, quality 0.82 (for scale)86,53184.5 KB36.1 dB
13 November 2026, Chromium 153.0.8010.12. Fidelity: PSNR against the original (higher is closer).

The two samples have the same pixel count, yet the PNG of the graphic is 22.2 KB and the PNG of the photo is 1245.3 KB, about 56 times larger. The photo PNG still saves something (it is 52% of the 2400.0 KB of raw pixel data) and decodes back to identical pixels, but the JPEG of the same photo is 84.5 KB.

The graphic's figure shows the other half of the story: flat colour and sharp edges compress to a small PNG. Its fidelity is not reported as identical because some semi-transparent pixels came back a fraction of a level off after the canvas round trip; no pixel moved by a whole level.

Questions

Is PNG lossless?

Yes. The filters and the deflate compression PNG uses are both reversible, so a decoder returns exactly the samples that were stored. On this page's photo sample the decoded PNG matched the original pixel for pixel.

How can I tell if a file is really a PNG?

Look at its first eight bytes in a hex viewer. Every PNG starts with 89 50 4E 47 0D 0A 1A 0A, and bytes two to four read "PNG". Anything else is a different format with a .png name, or a damaged file.

Why is my PNG so large?

Most often because it holds a photograph or another noisy, continuous-tone image. PNG's filters cannot predict noise, so there is little for deflate to compress. A lossy format such as JPEG or WebP will be much smaller for that kind of picture.

Can a PNG be animated?

Yes. Animated PNG (APNG) is part of the PNG specification since the Third Edition of 2025. It adds three chunks for animation control, frame control and frame data, and a viewer that does not support them still shows the static image.

What do PNG-8 and PNG-24 mean?

They are informal names, not terms from the specification. PNG-8 usually means an indexed-colour PNG with a palette of up to 256 colours; PNG-24 usually means truecolor at 8 bits per channel (PNG-32 when an alpha channel is added).

Sources

  1. W3C, 24 June 2025Portable Network Graphics (PNG) Specification (Third Edition)W3C Recommendation · opened 13 November 2026
  2. IANAMedia Types registry, image/* (apng, avif, heic, heif, jpeg, png, webp)Registry · opened 13 November 2026
  3. MDN Web Docs, 5 November 2026Image file type and format guideReference guide (page last modified 5 November 2026) · opened 13 November 2026

Working with a PNG file?

Turn a PNG into JPG, WebP or another format, or another format into PNG. The Image Converter runs in your browser tab, with no account.