How to Tell If a File Is Corrupted: Signs, Checks & Next Steps
You double-click a photo and get a black screen. A video plays for three seconds then freezes. A document opens as gibberish. These are classic signs of file corruption — but how do you confirm it, and what do you do next? This guide covers practical methods to detect corruption across every common file type.
What Is File Corruption?
File corruption occurs when a file's internal data structure becomes damaged or altered in unintended ways. Every file format — whether JPEG, MP4, DOCX, or ZIP — follows a specific binary structure with headers, data blocks, and metadata. When any part of this structure breaks, the file becomes partially or fully unreadable.
Corruption is not the same as deletion. A corrupted file still exists on your storage device, but its contents are damaged. Understanding this distinction matters because the tools and approaches for each problem are completely different.
Common Causes of Corruption
- Interrupted writes — power loss, system crash, or ejecting storage during file transfer
- Storage device failure — bad sectors on hard drives, worn-out flash memory on SSDs and SD cards
- Software bugs — application crashes during save operations, firmware issues in cameras
- Incomplete transfers — network drops during downloads, USB disconnection during copy
- File system errors — corrupted file allocation tables, journaling failures
- Bit rot — gradual degradation of storage media over time, especially on older drives
Signs of File Corruption by File Type
Different file types show corruption in different ways. Knowing what to look for helps you identify the problem quickly.
Photos (JPEG, PNG, RAW, HEIC)
| Symptom | Likely Cause |
|---|---|
| Gray or black areas in the image | Partial data loss — header intact but image data truncated |
| Color distortion or shifted pixels | Corrupted color channel data or broken compression blocks |
| "Invalid image" or "cannot open" error | Damaged file header — the format can't be identified |
| Image opens but looks scrambled | Corrupted Huffman tables (JPEG) or chunk data (PNG) |
| Thumbnail works but full image doesn't | Embedded thumbnail is separate from main image data |
| File size is 0 KB | Write operation failed completely |
For a deeper dive into photo-specific corruption, see our photo restoration guide.
Videos (MP4, MOV, AVI, MKV)
- Plays audio but no video (or vice versa) — one stream is corrupted while the other is intact
- Freezes at a specific timestamp — corrupted frame data at that point in the file
- Black screen with audio — missing or corrupted video codec headers
- "File format not supported" error — damaged container header (MOOV atom in MP4, RIFF header in AVI)
- Seeking doesn't work — broken index table, common in AVI files where the index is stored at the end
- Plays in one player but not another — partial corruption that some players can tolerate
Check our video repair guides for format-specific solutions.
Documents (DOCX, PDF, XLSX)
- Opens as garbled text or symbols — file header is damaged, application can't parse the format
- "The file is corrupted and cannot be opened" — Office/Reader detected structural damage
- Missing pages, images, or formatting — partial corruption in the document's internal XML or stream data
- File opens but crashes the application — severely malformed data causing parser errors
Archives (ZIP, RAR, 7z)
- CRC error during extraction — checksum mismatch, data was altered after compression
- "Unexpected end of archive" — file is truncated, download or transfer was incomplete
- Some files extract but others fail — corruption is localized to specific entries in the archive
- Cannot open archive at all — header or central directory is damaged
Databases (SQLite, MySQL, MSSQL)
- "Database disk image is malformed" — SQLite's integrity check failed
- Missing or garbled records — page-level corruption in the database file
- Application crashes on specific queries — corrupted index or data pages
- Sudden size changes — journal or WAL file corruption
How to Check If a File Is Corrupted
Beyond visual symptoms, there are systematic methods to verify file integrity.
Method 1: File Size Check
The simplest first step. Compare the file size against what you'd expect:
- 0 KB — the file is empty, write operation failed entirely
- Significantly smaller than expected — file is truncated (e.g., a 50 MB video showing as 2 MB)
- Exactly the same as another file — could indicate a copy error or placeholder
On macOS/Linux:
ls -lh filename.jpgOn Windows PowerShell:
Get-Item filename.jpg | Select-Object Name, LengthMethod 2: Checksum Verification
If you have the original checksum (from a download page, backup log, or sender), compare it:
On macOS/Linux:
# MD5
md5sum filename.ext # Linux
md5 -r filename.ext # macOS
# SHA-256 (more reliable)
sha256sum filename.ext # Linux
shasum -a 256 filename.ext # macOSOn Windows PowerShell:
Get-FileHash filename.ext -Algorithm SHA256If the hash doesn't match the original, the file has been altered — either by corruption or modification.
Method 3: File Header Inspection
Every file format starts with specific "magic bytes" that identify its type. If these are wrong, the file is corrupted at the most fundamental level.
| Format | Expected Magic Bytes (Hex) | ASCII |
|---|---|---|
| JPEG | FF D8 FF | ÿØÿ |
| PNG | 89 50 4E 47 | .PNG |
25 50 44 46 | ||
| ZIP | 50 4B 03 04 | PK.. |
| MP4 | 00 00 00 xx 66 74 79 70 | ....ftyp |
| AVI | 52 49 46 46 | RIFF |
Check with a hex editor or command line:
# macOS/Linux — view first 16 bytes
xxd -l 16 filename.ext
# Windows PowerShell
Format-Hex -Path filename.ext -Count 16If the first bytes don't match the expected magic bytes for the file's extension, the header is corrupted.
Method 4: Format-Specific Validation Tools
Some file types have dedicated validation tools:
Images — ExifTool:
exiftool filename.jpg
# If it returns "File format error" or missing critical tags, the file is corruptedVideos — FFprobe (part of FFmpeg):
ffprobe -v error filename.mp4
# Any output here indicates errors in the file structureArchives — Built-in test commands:
# ZIP
unzip -t archive.zip
# RAR
unrar t archive.rar
# 7z
7z t archive.7zDatabases — SQLite integrity check:
sqlite3 database.db "PRAGMA integrity_check;"
# Should return "ok" if the database is healthyMethod 5: Operating System Tools
Your OS has built-in tools to check storage-level integrity:
Windows:
# Check disk for file system errors
chkdsk D: /f
# System File Checker (for Windows system files)
sfc /scannowmacOS:
- Open Disk Utility → Select drive → Click First Aid
- Or via terminal:
diskutil verifyVolume /dev/disk2
Linux:
# Check ext4 filesystem (unmount first)
sudo fsck.ext4 /dev/sda1These tools check the storage device and file system, not individual files. Use them when you suspect the corruption source is the drive itself.
What to Do When You Confirm Corruption
Once you've identified a corrupted file, follow this decision tree:
Step 1: Don't Panic — and Don't Overwrite
The most important rule: work on a copy, never the original. Every repair attempt carries a small risk of making things worse. Keep the corrupted original as your safety net.
cp corrupted_file.jpg corrupted_file_backup.jpgStep 2: Assess the Severity
| Severity | Signs | Repair Outlook |
|---|---|---|
| Mild | File opens but has minor visual artifacts | High success rate with repair tools |
| Moderate | File partially opens or shows significant damage | Good chance with specialized repair |
| Severe | File won't open at all, header is destroyed | Possible with advanced tools, may be partial |
| Critical | File is 0 KB or completely overwritten | Recovery unlikely without backup |
Step 3: Choose the Right Approach
For photos — Try Magic Leopard Photo Repair for browser-based repair. It handles header reconstruction, partial recovery, and format-specific fixes for JPEG, PNG, RAW, and 12 other formats.
For videos — Use Magic Leopard Video Repair for MP4, MOV, AVI/WMV, and professional codecs. It rebuilds broken containers, reconstructs indexes, and fixes audio sync issues.
For documents — Try the application's built-in recovery (Word's "Open and Repair", Adobe's PDF repair), or use format-specific command-line tools.
For archives — Use the archive tool's repair function (zip -FF, rar r), or extract what you can and re-download the rest.
Don't Let Corrupted Files Ruin Your Day
Magic Leopard™ repairs corrupted photos and videos directly in your browser — powered by WebAssembly, your files never leave your device.
Step 4: Prevent Future Corruption
Once you've recovered your files, take steps to prevent it from happening again:
- Follow the 3-2-1 backup rule: 3 copies, 2 different media types, 1 offsite
- Always safely eject removable storage before disconnecting
- Use UPS or battery backup to prevent power-loss corruption
- Verify transfers by comparing checksums after copying important files
- Monitor storage health with S.M.A.R.T. tools
For a comprehensive prevention strategy, see our file corruption prevention guide. For a complete backup setup, check our photo backup protection guide.
Frequently Asked Questions
How can I tell if a file is corrupted without opening it?
Check the file size first — a 0 KB file or one significantly smaller than expected is likely corrupted. You can also verify the file's checksum (MD5 or SHA-256) against the original if available, or inspect the file header with a hex editor to confirm the magic bytes match the expected format.
Can a corrupted file damage my computer?
No, a corrupted file itself cannot damage your computer or spread like a virus. Corruption means the file's data structure is broken, not that it contains malicious code. However, if corruption was caused by a failing hard drive, that hardware issue could affect other files too.
Why does my photo show gray areas or missing sections?
Gray areas in photos typically indicate partial corruption — the file header is intact enough to open, but some image data blocks are damaged or missing. This commonly happens with interrupted transfers, SD card errors, or incomplete downloads. A photo repair tool can often reconstruct the missing sections.
Is there a way to check multiple files for corruption at once?
Yes. Use checksum verification tools like md5sum or sha256sum in the terminal to batch-check files against known good hashes. On Windows, PowerShell's Get-FileHash command works for batch processing. For photos specifically, tools like ExifTool can batch-validate metadata integrity across entire folders.
Can corrupted files be repaired?
Many corrupted files can be repaired, depending on the type and severity of corruption. Header damage and index corruption are usually fixable. Tools like Magic Leopard can repair corrupted photos and videos directly in your browser. For severe corruption where actual data is overwritten, recovery may be partial or impossible.
What's the difference between a corrupted file and a deleted file?
A corrupted file still exists on your storage but has damaged internal data — it may open partially or not at all. A deleted file has been removed from the file system's directory but the data may still exist on disk until overwritten. Corrupted files need repair tools; deleted files need recovery tools.
Got Corrupted Photos or Videos?
Magic Leopard™ repairs corrupted files directly in your browser — no software to install, files never leave your device.