Wondering what is inside a PNG? The PNG file structure is a signature followed by a series of labeled chunks, running from the header through the image data to a closing trailer.
This page is part of the series on the png file format, and it zooms in on what sits inside the file.
| Item | Value |
|---|---|
| Specification | RFC 2083, PNG (Portable Network Graphics) Specification Version 1.0 |
| Published | March 1997 |
| Critical chunks | IHDR, PLTE, IDAT, IEND |
| Sample depth range | 1 to 16 bits |
| Filter types | Five: None, Sub, Up, Average, Paeth |
| Internet media type | image/png |
These figures come from the RFC 2083 page at the RFC Editor and the matching IETF Datatracker entry. They describe the original specification, and sources can change, so check the source before you rely on them.
What does a PNG file contain, at a glance?
A PNG is not one undivided block of pixels. The specification describes an extensible file format for the lossless, portable, well-compressed storage of raster images, and that extensibility comes from its chunk design, as the RFC 2083 abstract explains.
Think of the file as a container with a few labeled compartments:
- A file signature that identifies the data as PNG.
- A header chunk (IHDR) that describes the image.
- Optional chunks that carry extras such as text, gamma or transparency.
- One or more image data chunks (IDAT) holding the compressed pixels.
- A trailer chunk (IEND) that closes the file.
The exact placement of each chunk is governed by the specification’s ordering rules, covered further down.

Signature, chunk layout and integrity checks
The specification’s file structure section is built around four topics. They are the quickest way to see what a parser has to understand first.
- The PNG file signature
- The chunk layout
- Chunk naming conventions
- The CRC algorithm
The CRC matters because PNG is designed to be robust. In the abstract’s words, it provides full file integrity checking and simple detection of common transmission errors, which is why a damaged download is usually caught rather than silently displayed wrongly.
You can also read part of the naming system straight from the chunk names. Critical chunks such as IHDR and IDAT are written in capitals, while optional ones such as tEXt and gAMA mix in lowercase letters.
This page does not reproduce byte-level details such as the exact signature bytes or the field sizes in a chunk. For those, open the signature and chunk layout sections of the specification itself.
Critical chunks: the four a decoder cannot skip
The specification groups its standard chunks into critical and ancillary. The critical group is short, and its entries appear in this order in the specification’s contents:
- IHDR, the image header
- PLTE, the palette
- IDAT, the image data
- IEND, the image trailer
Those four cover the image types the format supports. According to the RFC 2083 abstract, indexed-color, grayscale and truecolor images are supported, plus an optional alpha channel, and sample depths range from 1 to 16 bits.
Ancillary chunks: optional extras
Everything outside the critical group is ancillary, meaning a picture can still be rebuilt without it. The specification lists these standard ones:
- bKGD: background color
- cHRM: primary chromaticities and white point
- gAMA: image gamma
- hIST: image histogram
- pHYs: physical pixel dimensions
- sBIT: significant bits
- tEXt: textual data
- tIME: image last-modification time
- tRNS: transparency
- zTXt: compressed textual data
Several of these exist for color accuracy. The format can store gamma and chromaticity data for improved color matching on heterogeneous platforms, per the specification abstract.
The same document also has a section on additional chunk types and one on private chunks, so the list above is a starting point rather than a closed set.
How pixel data is prepared
Pixels do not go into IDAT raw. The specification devotes a section to Deflate/Inflate compression and another to filter algorithms, and the filters come first in the pipeline described there.
It names five filter types, and each is a different way of predicting a row from its neighbors:
- None
- Sub
- Up
- Average
- Paeth
Interlaced data order is a separate topic in the data representation section. It ties in with the format’s streaming design: PNG is described as fully streamable with a progressive display option, which suits online viewing such as the World Wide Web, according to the RFC text.
Chunk ordering rules and how to read the spec
Chunks cannot appear in any order you like. The specification has a section on chunk ordering rules, with parts for the behavior of PNG editors, the ordering of ancillary chunks and the ordering of critical chunks.
It also lists a multiple-image extension under miscellaneous topics. If you want to see how animation relates to this layout, read what is apng.
A note on status: the memo itself says it does not specify an Internet standard of any kind, and the IETF Datatracker page for RFC 2083 states that the RFC is not endorsed by the IETF and has no formal standing in the IETF standards process. Treat it as a reference text, and if your goal is simply to view a file, see how to open a png file.
This site is independent and has no affiliation with any software vendor, format body or tool maker.
Frequently asked questions
What are the main parts of a PNG file?
Show answer
Start with a signature, then a sequence of chunks. Four of them are critical, and optional ones can carry text, color and size information.
What is the difference between critical and ancillary chunks?
Show answer
Critical chunks form the minimum a decoder needs to show the picture: header, palette, data and trailer. Ancillary chunks add information such as background color or a modification time.
Does PNG compression lose image quality?
Show answer
No. The specification calls PNG a format for lossless storage, so compression and filtering change how the data is stored, not what the pixels are.
Is the PNG specification an official Internet standard?
Show answer
Not through this document. Its own memo says it is informational, and the IETF Datatracker notes it has no formal standing in the IETF process.



