Image repair  /  PNG & JPEG  /  runs in your browser

Repair a corrupted image file

Free online tool to fix damaged JPG and PNG photos that will not open. It reads the file byte by byte, tells you exactly what is broken, repairs what can be repaired and recovers what is left of the rest.

Detects
8 formats
Repairs
PNG & JPEG
Checks
21 fault types
Max file
40 MB
Uploads
None
Repair tool runs locally
  • Format read from the bytes, never from the file extension
  • Full structural map with hex offsets, block names and sizes
  • Row-by-row recovery for PNG files with a truncated stream
  • Header grafting for JPEG, using a healthy photo from the same camera
  • EXIF thumbnail extracted when the main image is gone
  • Nothing uploaded — no server, no network request, no stored copy
  • Photo will not open
  • Invalid image file
  • Interrupted download
  • Failed SD card
  • Bad USB transfer
  • FTP in ASCII mode
  • Email attachment mangled
  • Half-written by a crash
  • Wrong file extension
  • Recovered from a deleted partition
  • Old backup that no longer opens
  • Camera pulled mid-write
01The diagnosis

It tells you what you are dealing with

Before anything is written, the file gets a verdict. Knowing which of the four you have saves you from chasing a recovery that was never possible.

Verdicts four outcomes

File intact

The structure checks out. If it still will not open, the problem is the program you are opening it with, not the file.

Repairable

The image data is all there behind a broken container. Rebuild the structure and you get the photo back whole.

Partly recoverable

The file was cut short. Everything above the break comes back; below it there is nothing to come back.

Not recoverable

No usable image data survives. Said plainly, rather than after twenty minutes of a progress bar.

02Structural map

You see the file, not a spinner

Every segment is listed with its hex offset, its real name and its size. PNG chunks by their actual identifiers, JPEG markers by their technical designation.

Example scan truncated PNG
OffsetBlockSizeNote
0x000000SIGNATURE8 BValid
0x000008IHDR25 B3024 × 4032 · RGBA · 8 bit
0x000021tEXt64 BValid
0x000061IDAT1.84 MBValid
0x1D8A40IDAT412 KB / 890 KBTruncated inside block
IENDMissing
03Faults it finds

Twenty-one ways a photo breaks

Each fault is named, explained, and marked with what can be done about it. Repeated faults are grouped with a count instead of flooding the report.

PNG eleven checks
FaultUsual causeOutcome
Signature alteredFTP transfer in ASCII modeREPAIRABLE
CRC32 mismatchA flipped byte in storage or transferREPAIRABLE
IEND missingCopy or download stopped earlyREPAIRABLE
Chunk truncatedWrite interrupted; declared length exceeds what is presentPARTIAL
Foreign bytes in streamOverwritten sector; realigns to the next valid chunkPARTIAL
No IHDR foundHeader destroyed or file is not a PNGDATA LOST
No IDAT presentContainer survived, image data did notDATA LOST
Chunk sequence brokenSevere damage with no valid re-entry pointDATA LOST
Implausible dimensionsCorrupted header valuesDATA LOST
Invalid bit depthValue outside what the format allowsDATA LOST
Invalid colour typeValue outside what the format allowsDATA LOST
JPEG ten checks
FaultUsual causeOutcome
SOI marker missingBytes lost from the head of the fileREPAIRABLE
Foreign bytes prependedJunk written before the image; the exact count is reportedREPAIRABLE
EOI marker missingTransfer or write stopped earlyREPAIRABLE
Quantisation tables missingHeader damaged — candidate for graftingPARTIAL
Huffman tables missingHeader damaged — candidate for graftingPARTIAL
Frame header missingSOF segment destroyedPARTIAL
Truncated inside a markerFile ends mid-segmentPARTIAL
Inconsistent segment lengthDeclared length does not match the dataPARTIAL
Scan start not foundSOS marker missingDATA LOST
No compressed data after SOSThe image stream itself is goneDATA LOST
04How it recovers

Four techniques, tried in order

01 / Native decode

Try the browser first

Before anything is repaired, the file goes to the browser's own decoder, which is far more forgiving than the average desktop application. A surprising share of files that "will not open" elsewhere render immediately here, with no repair needed at all.

It costs nothing to try, and it is the reason some sessions end in three seconds.

02 / Structure repair

Fix the container, keep the pixels

For PNG: the signature is rewritten, CRC32 checksums are recalculated, the IEND block is restored, truncated chunks are rewritten with their real length. For JPEG: junk bytes are stripped from the front, and the SOI and EOI markers are put back.

The pixels are never touched. On a file whose only fault is a bad checksum, the output is byte-for-byte identical to what the healthy original would have been.

03 / Row recovery

Salvage what arrived (PNG)

When a PNG's compressed stream stops mid-file, every row that actually made it is decoded and kept, with the recovered percentage stated. All five PNG filters are supported — None, Sub, Up, Average and Paeth — along with 1 to 16 bit depths, every colour type, palettes and indexed transparency.

Rows that never arrived stay empty. They are not filled in, guessed at or generated.

04 / Header grafting

Borrow the tables (JPEG)

A JPEG's decoding tables depend on the camera model and the quality setting, not on the individual shot. So a healthy photo from the same camera can supply the header a damaged one has lost — which is why the tool asks for a reference file rather than inventing values.

Because a single byte of misalignment makes Huffman decoding impossible, several candidate boundaries are generated for the start of the compressed data and tried one after another until the image decodes. The offset that worked is reported with the result.

05 / Last resort

The thumbnail inside the file

Cameras embed a small preview in the EXIF block, physically separate from the main image stream. When the main stream is beyond recovery, that thumbnail is often the only readable picture left in the file — small, but frequently enough to identify what the photo was.

It is extracted and offered as a standalone JPEG.

05Formats and output
Formats read from the bytes
FormatSupport
PNGDIAGNOSE · REPAIR · RECOVER
JPEGDIAGNOSE · REPAIR · RECOVER
GIFIDENTIFIED
WEBPIDENTIFIED
BMPIDENTIFIED
TIFFIDENTIFIED
HEIF / HEICIDENTIFIED
PSDIDENTIFIED
Downloads depending on the case
OutputNote
Repaired fileWith the exact list of what was changed
Rebuilt PNGFrom decoded pixels, no quality loss
Rebuilt JPEGInvolves recompression, stated upfront
Grafted fileWith the byte offset that worked
EXIF thumbnailStandalone JPEG

The wrong extension is the single most common reason a file "will not open" — a .jpg that is really a PNG or an HEIC. That is flagged immediately, and renaming the file is usually the whole fix.

06Honest limits

What this cannot do

Worth reading before you start, because it will save you a disappointment that other tools let you walk into.

No invented pixels

Lost parts stay empty. Nothing is generated, guessed at or filled in — because a plausible reconstruction of a photograph is not the photograph, and on a document or a piece of evidence it would be actively harmful.

JPEG has no checksum

Unlike PNG, the format carries no way to verify its own contents. The tool can tell you where the stream stops; it cannot tell you whether a single value inside it was altered.

PNG breaks all at once

The compressed stream is continuous. Above the break everything comes back, below it nothing does. There is no middle ground and no partial rescue of the tail.

Interlaced PNG

Row-by-row recovery does not apply, because interlaced files do not store their data in row order. Diagnosis and structural repair still work.

Size ceiling

40 MB per file, and no row-by-row rebuild beyond 40 megapixels. Past that the browser runs out of memory, and failing cleanly is better than crashing the tab.

Repair, not restoration

This fixes files that are structurally broken. It does not sharpen, denoise, upscale or colour-correct — a blurry photo is not a damaged one.

08FAQ
How do I repair a corrupted image file online?
Drop the damaged photo into the tool above. It reads the file byte by byte, reports what is broken and gives you one of four verdicts. If the file is repairable you can download a fixed copy straight away; if only part of it survived, you get back what was there. No account and nothing to install.
Why will my JPG not open?
The most common reason is that it is not a JPG at all — a PNG or HEIC saved with the wrong extension. After that: the start or end marker is missing, junk bytes were written before the image, or the transfer stopped partway. All of these are detected, and the first three are repairable.
Can it recover a photo that was only half copied?
Partly. For PNG, every row that actually made it into the file is decoded and kept, and you are told what percentage was recovered. The rows that never arrived stay empty — nothing is invented to fill them.
What is header grafting?
A JPEG's decoding tables depend on the camera and quality setting rather than the individual photo, so a healthy image from the same camera can supply the header a damaged one has lost. The tool tries several candidate starting points for the compressed data until the image decodes, since being off by one byte makes decoding impossible.
Are my files uploaded to a server?
No. Everything runs in your browser — no upload, no server copy, not a single network request carrying your data. The decompression library ships with the tool, so not even a CDN call is needed. That matters here, because damaged files are often the last copy of something irreplaceable.
Which formats can it repair?
PNG and JPEG can be diagnosed, repaired and recovered. GIF, WebP, BMP, TIFF, HEIF/HEIC and PSD are identified from their byte signature, so you at least learn what the file really is — often the answer on its own.
Is there a file size limit?
40 MB per file, and row-by-row rebuilding is capped at 40 megapixels. Both limits exist to avoid exhausting the browser's memory on very large images.
Will the repaired photo lose quality?
Structural repair never touches the pixels, so no. A PNG rebuilt from decoded pixels is also lossless. Only a rebuilt JPEG involves recompression, and the tool says so before you download it.

Free / unlimited / stays on your device

Find out what is actually wrong

Drop the damaged file here

JPEG and PNG are analysed byte by byte. Other formats are identified and checked.

Your file stays on your device. Nothing is uploaded, nothing is stored on the server.

  • Runs locally

    Analysis and repair happen in your browser. The file is never sent anywhere.

  • Diagnosis before repair

    The tool shows where the file breaks and why, even when there is nothing left to recover.

  • No invented pixels

    You get back only what the file actually holds. Lost parts stay blank.