file in abyss
Back to formats

Image

PNG Portable Network Graphics

Portable Network Graphics is a image format commonly identified by .png. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .png
MIME image/png

Magic numbers

Analyze your file
offset 0 Portable Network Graphics leading signature
89 50 4E 47 0D 0A 1A 0A
.PNG....

Structure

  1. Signature
  2. IHDR chunk
  3. Optional chunks
  4. IDAT chunk
  5. IEND chunk

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 89 50 4E 47 0D 0A 1A 0A, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("89504e470d0a1a0a")
OFFSET = 0

def is_png(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

Portable Network Graphics is commonly used for image previews, thumbnails, metadata checks, and upload validation. Test multiple sizes because resolution, alpha support, compression, and file size often affect implementation behavior.

Common detection mistakes

  • The .png extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • Portable Network Graphics can start with signatures such as 89 50 4E 47 0D 0A 1A 0A, but related containers and damaged files may require additional validation.

Security notes

Media files can still stress decoders through corrupt metadata, extreme dimensions, long durations, or unusual chunks. Read size, dimensions, and duration before processing.

Using samples

8 samples help test tiny images, high-resolution images, alpha channels, and hard-to-compress assets.

Sample files

8 / 8 files
Sample Traits Size Source / license / SHA-256
Blue Sky PNG preview

Blue Sky PNG

Blue Sky PNG is a Portable Network Graphics sample based on Wikimedia Commons, 512 x 384. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.png
Resolution 512 x 384 197 Kpx
Preview
173 KB
SHA-256 8c4e8b9755c9a7a830220dbc1976923c1b25433377773567ed456ce64b6f5890
Download
Flower Garden PNG preview

Flower Garden PNG

Flower Garden PNG is a Portable Network Graphics sample based on Wikimedia Commons, 640 x 360. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.png
Resolution 640 x 360 230 Kpx
Preview
361 KB
SHA-256 936f1936e08d92332d322d1375d8bdce7acdbeb110659d7e56f0ba10eb9fe5c7
Download
Navy Blue Sky PNG preview

Navy Blue Sky PNG

Navy Blue Sky PNG is a Portable Network Graphics sample based on Wikimedia Commons, 768 x 383. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.png
Resolution 768 x 383 294 Kpx
Preview
380 KB
SHA-256 0135de555c0d98a165ea21adddbe53f41477c1e2009162dca0b80ce3891de225
Download
Nature Sky PNG preview

Nature Sky PNG

Nature Sky PNG is a Portable Network Graphics sample based on Wikimedia Commons, 720 x 540. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.png
Resolution 720 x 540 389 Kpx
Preview
207 KB
SHA-256 7b34840dee4f5fecbea7aec51c9113ef7fcf4b08c38e21f3a9604d1b89f59513
Download
Sky Landscape PNG preview

Sky Landscape PNG

Sky Landscape PNG is a Portable Network Graphics sample based on Wikimedia Commons, 768 x 576. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.png
Resolution 768 x 576 442 Kpx
Preview
486 KB
SHA-256 55ef3c8803651b27f7cef6214dba60c1ca73ffe427c529acba4bd642d853a8ea
Download
Blue Night Sky PNG preview

Blue Night Sky PNG

Blue Night Sky PNG is a Portable Network Graphics sample based on Wikimedia Commons, 960 x 640. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.png
Resolution 960 x 640 614 Kpx
PreviewLarge file
1.12 MB
SHA-256 e926f8cd9f981d98f256acaf82e2266733e7d8d1507861904b53ebf5508925d3
Download
NASA Earth 2048x2048 PNG preview

NASA Earth 2048x2048 PNG

NASA Earth 2048x2048 PNG is a Portable Network Graphics sample based on Wikimedia Commons, 2048 x 2048. It can be used to test downloads, parsers, previews, and file type detection.

nasa-earth-2022.png
Resolution 2048 x 2048 4.2 MP
High resLarge file
3.15 MB
SHA-256 f2bf466a5173fec5b3e0492312138c026d83dcd1c5980c45383d6684d07aad0a
Download
NASA Blue Marble PNG preview

NASA Blue Marble PNG

NASA Blue Marble PNG is a Portable Network Graphics sample based on NASA Image and Video Library, 640 x 640. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.png
Resolution 640 x 640 410 Kpx
Preview
459 KB
SHA-256 245e1a4eecaf262b7bbab32320b42e80b378ecf89f1642f6b36df4c77f543056
Download

Frequently asked questions

What is the magic number (file signature) of Portable Network Graphics?

Portable Network Graphics files begin with the byte signature 89 50 4E 47 0D 0A 1A 0A (".PNG...."). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of Portable Network Graphics?

The MIME type for Portable Network Graphics is image/png.

What file extension does Portable Network Graphics use?

Portable Network Graphics files use the .png extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats