Overview
Introduction
This tool checks whether a PNG file is structurally intact, entirely in your browser, without decoding it into a full image.
It's useful for diagnosing 'why won't this PNG open' problems caused by truncated downloads or corrupted transfers.
What Is PNG Tester?
A client-side PNG structural validator that reads a file's raw bytes and walks its chunk-based format the same way any PNG decoder would internally, without needing an actual decode/render step.
It reports every chunk found, in order, along with any structural problems it detects along the way.
How PNG Tester Works
After confirming the 8-byte magic signature at the start of the file, the tool reads each chunk's 4-byte length and 4-byte type, then recomputes a CRC-32 checksum over the chunk's type and data and compares it to the 4-byte checksum stored right after the chunk, exactly as the PNG spec defines.
It also confirms the very first chunk is IHDR (image header) and that the file ends with an IEND chunk, both of which every valid PNG must have.
When To Use PNG Tester
Use it when a PNG file won't open somewhere, to check whether the file itself is corrupted versus a problem with the app trying to open it.
It's also handy after writing your own PNG-generating code, to sanity-check the output is structurally sound.
Often used alongside PNG to Base64 Converter and PNG Dimensions Finder.
Features
Advantages
- Runs entirely client-side; the file is never uploaded anywhere.
- Uses the exact same CRC-32 algorithm the PNG spec itself defines, so results are authoritative for corruption detection.
- Reports every chunk type found, useful for understanding what's actually inside a PNG file.
Limitations
- This is a structural/checksum test, not a full image decoder; it can't catch problems that don't corrupt bytes, like unsupported color types in a specific viewer.
- A truncated file will typically be flagged for its missing IEND chunk and/or a truncated final chunk rather than a specific 'download was cut short' diagnosis.
Examples
Best Practices & Notes
Best Practices
- If a PNG fails validation, try re-downloading or re-exporting it rather than attempting to use the corrupted file.
- Check the chunk list to understand what's actually stored in the file (for example, extra metadata chunks) beyond just pass/fail.
Developer Notes
The CRC-32 implementation is a from-scratch table-driven version of the same algorithm the PNG/ZIP formats specify (polynomial 0xEDB88320), operating on a plain Uint8Array so it needs no external library; the chunk walk is a simple length-prefixed loop with bounds checks to catch truncated files safely.
PNG Tester Use Cases
- Diagnosing why a downloaded PNG won't open
- Verifying the output of custom PNG-generation code
- Confirming a file transfer completed without byte corruption
Common Mistakes
- Treating a passing structural test as a guarantee the image renders correctly everywhere — it only confirms the bytes are internally consistent, not that every viewer supports every feature used.
- Assuming any non-PNG file will simply be rejected outright rather than reported as invalid with specific issues.
Tips
- If you just need to confirm a file starts with a valid PNG signature quickly, the base64 converter tool also performs that check.
- Run this before and after any manual byte-level editing of a PNG to catch mistakes early.