Overview
Introduction
This tool repairs common structural corruption in a PNG file — the kind of damage that happens from a truncated download, a bad copy, or a byte-level editing mistake — right in your browser.
It fixes the file's container structure, not its pixel content: think of it as repairing the packaging, not repainting what's inside.
What Is Broken PNG Fixer?
A byte-level PNG structural repair tool that walks the file's chunk stream, validating and correcting the container-level details every PNG parser depends on.
It fixes four specific classes of structural issue: a garbled file signature, incorrect chunk CRC-32 checksums, a truncated trailing chunk, and a missing terminating IEND chunk.
How Broken PNG Fixer Works
First, it checks the standard 8-byte PNG signature; if it's wrong but a valid-looking 13-byte IHDR chunk immediately follows, the signature is rewritten rather than the file being rejected outright.
It then walks every chunk, recomputing each one's CRC-32 over its type and data and replacing the stored value if it doesn't match, drops any trailing chunk whose declared length runs past the end of the file, and appends a fresh IEND chunk if one was never found.
When To Use Broken PNG Fixer
Use it when a PNG fails to open, shows as broken in an image viewer, or was flagged as invalid by another tool, and you suspect the damage is at the file-structure level rather than in the actual pixel data.
It's also a fast way to double-check and, if needed, clean up PNGs produced by hand-editing tools or partial/interrupted downloads.
Often used alongside PNG Validator, PNG Metadata Eraser and PNG Text Remover.
Features
Advantages
- Runs entirely client-side; the uploaded file is never sent to a server.
- Only rewrites the signature when there's real evidence (a matching IHDR) that the file is genuinely a PNG, avoiding false fixes on non-PNG data.
- Reports exactly what it fixed, so you know precisely what changed.
Limitations
- It cannot repair corrupted pixel data inside a damaged IDAT/DEFLATE stream — only the surrounding container structure.
- A file with no plausible IHDR chunk after its signature is rejected as unrepairable rather than guessed at.
Examples
Best Practices & Notes
Best Practices
- Run PNG Validator afterward to confirm the repaired file now passes structural checks.
- If the image still won't render after repair, the damage is likely inside the compressed pixel data itself, which this tool can't fix.
Developer Notes
The lib function hand-implements a CRC-32 table and checksum (matching the PNG spec's algorithm) and walks the chunk stream with pure byte-array logic: it verifies/rewrites the signature only when a 13-byte-length "IHDR" chunk follows, recomputes each chunk's CRC-32 and replaces mismatches, truncates cleanly at any chunk whose declared length runs past the file's end, and synthesizes a correct IEND chunk if one is missing — deliberately scoped to container-level structure, not DEFLATE stream repair.
Broken PNG Fixer Use Cases
- Recovering a PNG that was truncated by an interrupted download
- Fixing a file with corrupted CRC checksums from a faulty transfer or hand-edit
- Adding a missing IEND chunk to a PNG produced by a buggy export tool
Common Mistakes
- Expecting this to fix visible garbage/corruption in the actual picture — that's pixel-data damage, which is out of scope.
- Running this on a file that isn't PNG data at all; without a plausible IHDR chunk, the tool correctly refuses to guess.
Tips
- Check the issuesFixed list to understand exactly what kind of corruption your file had.
- Pair this with PNG Validator: run it first to diagnose, then Broken PNG Fixer to repair, then Validator again to confirm.