PNG Validator

Gives a single, comprehensive verdict on whether a file is a well-formed PNG by combining a quick signature/IHDR sanity check with a full chunk walk that verifies every chunk's CRC-32. A file only counts as fully valid here if both checks agree it is, and the report lists chunk count, chunk types found, and any specific issues detected. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool gives you a clear pass/fail verdict on whether a file is a genuinely well-formed PNG, with a detailed breakdown of exactly what was checked, right in your browser.

It's useful whenever you're not sure if a file that claims to be a PNG actually is one, or want to confirm a repair or edit didn't introduce structural damage.

What Is PNG Validator?

A byte-level PNG structure validator that combines two checks: a fast signature/IHDR sanity check, and a full chunk walk that verifies every chunk's declared length and CRC-32 checksum.

The report includes the total chunk count, every chunk type found in order, and a list of any specific issues detected during the walk.

How PNG Validator Works

First, the file's 8-byte signature and IHDR chunk are checked for basic well-formedness.

Then every chunk in the file is walked in sequence: its declared length is used to locate its data and CRC-32 trailer, the CRC is recomputed and compared, and any mismatch, truncation, or missing IEND is recorded as an issue; the file is only reported as fully valid if both the sanity check and the full chunk walk agree.

When To Use PNG Validator

Use it when a file that's supposed to be a PNG won't open, to see exactly what's wrong with its structure.

It's also useful as a final check after repairing a file with Broken PNG Fixer, or before shipping a hand-edited or programmatically generated PNG.

Features

Advantages

  • Runs entirely client-side; the uploaded file is never sent to a server.
  • Combines two independent checks so a file has to pass both signature/IHDR sanity and full CRC verification to be called valid.
  • Reports specific issues rather than just a bare true/false verdict.

Limitations

  • This tool only reports problems; it doesn't fix them — pair it with Broken PNG Fixer for repair.
  • A structurally valid PNG can still have corrupted pixel data inside its IDAT stream that structural validation alone can't detect; only actually decoding the image would reveal that.

Examples

A well-formed PNG

Input

A normally exported 100x100 PNG

Output

isValidPng: true, hasValidSignature: true, hasValidIhdrChunk: true, chunkCount: 4, chunkTypes: [IHDR, IDAT, IEND, ...], issues: []

Both the sanity check and the full chunk walk agree the file is well-formed.

A file with a bad CRC

Input

A PNG with one chunk's CRC-32 manually corrupted

Output

isValidPng: false, issues: ["Chunk \"tEXt\" has an invalid CRC-32 checksum."]

The chunk walk recomputes and compares every CRC, catching even a single corrupted checksum.

Best Practices & Notes

Best Practices

  • Run this after using Broken PNG Fixer to confirm the repair actually resolved the structural issues.
  • Check the chunkTypes list if you're curious whether a file carries metadata chunks like tEXt or iCCP before further processing it.

Developer Notes

The lib function is a thin composition layer: it calls this category's existing verifyPng (signature/IHDR sanity check) and testPngFile (full chunk walk with CRC-32 verification) helpers and combines their results into one report, requiring both to agree before reporting isValidPng: true, rather than re-deriving either check's logic.

PNG Validator Use Cases

  • Diagnosing why a PNG file won't open in an image viewer
  • Confirming a repair tool or hand-edit didn't introduce new structural damage
  • Auditing a batch of PNGs for corruption before further processing

Common Mistakes

  • Treating a "valid" verdict as a guarantee the pixel content itself is correct — structural validity doesn't detect a corrupted IDAT/DEFLATE stream.
  • Expecting this tool to repair issues it finds — use Broken PNG Fixer for that.

Tips

  • If validation fails, check the issues list first — it often points directly to what Broken PNG Fixer needs to repair.
  • Use this as a quick sanity check before uploading a PNG to a system that might reject malformed files outright.

References

Frequently Asked Questions