To fix a corrupted file, first make a copy of it, then try the program's own repair option (in Word, Open and Repair), and if that fails, restore an earlier version from File History, OneDrive or a backup. If several files are damaged at once, check the drive with chkdsk before you trust it with anything else.
Which fix applies depends on what is broken: one file, many files, or the disk they sit on. Work through the sections in order, because each step is less risky than the next.
Step 1: Copy the file before you touch it
Repair attempts can overwrite the original. Copy the damaged file to another folder or drive and work on the copy. If the file is on a USB stick or an external drive that has started throwing errors, copy it to your main drive first, and don't keep writing to the failing drive.
It also helps to find out whether the file is the problem or the program. Microsoft's Word troubleshooting guide suggests two checks: try other documents of the same kind, and look for the same behaviour in other Office programs. If other files open fine, the damage is probably in this one file. If every file misbehaves, the cause is the program or the operating system.
Step 2: Check whether the drive is the cause
One corrupted file can be bad luck. Several in a row, especially after a crash or power loss, point at the file system or the disk. Open Command Prompt as administrator and run chkdsk with no parameters first:
chkdsk D:
Without parameters, chkdsk only reports the status of the volume and fixes nothing. Microsoft notes that on an active partition it can report spurious errors because it cannot lock the drive, so treat a report from a drive in use as a hint, not a verdict.
To fix logical errors, add /f. To also look for bad sectors and recover readable data, use /r, which includes the functionality of /f:
chkdsk D: /f
chkdsk D: /r
The disk must be locked for these to run. If files on the drive are open, you will see this message (exact text from Microsoft's documentation):
Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)
Answer Y and restart. For the system drive, chkdsk runs at boot and restarts the computer when it finishes. A /r scan reads every sector, so on a large hard drive it can take hours. Interrupting it is not recommended, though Microsoft says an interrupted run should not leave the volume more corrupt than before.
On FAT volumes, chkdsk /f may ask Convert lost chains to files?. If you press Y, the recovered fragments are saved in the root folder as File<nnnn>.chk. Open them in a text editor or the matching program to see whether they hold anything you need. Pressing N fixes the disk but discards that content.
To read the result afterwards, run this in PowerShell (it lists the latest chkdsk log entries from the Application log):
get-winevent -FilterHashTable @{logname="Application"} | ?{$_.providername -match "chkdsk"} | fl timecreated, message
If chkdsk keeps finding errors on the same drive, the hardware may be failing. See how to check hard drive health, and move your data off the drive.
Step 3: Repair a corrupted Word document
Microsoft's guide for damaged Word documents lists several methods, to be tried in order. The ones that most often matter:
- Open and Repair. In Word, select File, then Open. Click the document once to highlight it, select the arrow on the Open button, and choose Open and Repair.
- Open in Draft view without updating links. On the View tab, select Draft. Then go to File, Options, Advanced, clear Update automatic links at open, close Word and open the file again.
- Insert it into a new document. Create a blank document, then on the Insert tab choose Insert Object, then Text From File, and pick the damaged file.
- Recover Text from Any File. In the Open dialog, set Files of type to Recover Text from Any File(*.*). Microsoft warns that formatting, graphics and other non-text items are lost, and some binary text remains at the start and end of the document, which you must delete before saving.
- Open it in Notepad. Right-click the file, choose Open with, then Notepad. You see extra code around your text. Delete it, then use Save As with a new name so you don't overwrite the damaged file. All formatting is lost.
If the document opens but behaves strangely, copy everything except the last paragraph mark into a new document: press Ctrl+End, then Ctrl+Shift+Home, copy, and paste into a blank one. Microsoft also suggests saving the file as Rich Text Format (.rtf), closing it, reopening the .rtf and saving it back as a Word document.
If you were editing when Word or Windows crashed, the file you want may not be the damaged one. Word searches for AutoRecover files each time it starts, and File, Info, Manage Document, Recover Unsaved Documents opens the unsaved copies. For older saved versions, see how to recover a previous version of a Word document.
Step 4: Restore a clean copy
For most file types there is no built-in repair, and this is the most reliable route. Look for an intact copy in this order:
- The sender or the source. For a corrupted download or email attachment, download or request it again.
- OneDrive or SharePoint version history. Files synced there keep earlier versions you can restore.
- File History or a backup. Right-click the file or its folder, then use Restore previous versions if File History is on. The steps are in restoring a previous version of a file in Windows.
- The Recycle Bin and recovery tools. If an older copy was deleted, see how to see recently deleted files.
When you re-download a file that publishes a checksum, compare it with the published value. A mismatch means the copy is still damaged. The larely checksum tool computes file hashes in your browser, without uploading the file.
When the damaged file is a Windows system file
If a program in Windows itself fails, a protected system file may be the culprit. System File Checker can verify a single file without changing it:
sfc /verifyfile=c:\windows\system32\kernel32.dll
/verifyfile checks the integrity of one file without repairing it, while /scanfile also attempts a repair, and /scannow scans and repairs all protected system files. All of these need an administrator account. The full routine, including DISM when SFC cannot repair, is in SFC /scannow and DISM. SFC covers only protected system files, so it will not fix your documents, photos or archives.
If nothing works
Stop writing to the drive that holds the file, because every new write lowers the chance of recovering anything from it. Keep the untouched copy you made in step 1. If the data matters, a professional recovery service or a disk imaging tool run from another computer is safer than repeated repair attempts on the original. If the file was only partly written, whatever is missing may be gone for good, and the honest answer is to recreate it from your latest backup.
Frequently asked questions
- Can a corrupted file always be fixed?
- No. Repair tools can only work with the data that is still readable. A Word document with a damaged header may open through Open and Repair, but a file whose contents were overwritten or never fully written cannot be rebuilt. A backup, File History or OneDrive version history is the only dependable fix.
- Does chkdsk repair the file itself?
- No. chkdsk checks the file system structures of a volume, such as the index and allocation tables. With /f it fixes those logical errors, and with /r it also looks for bad sectors and tries to recover readable data. It does not know how to repair the internal format of a .docx or a photo.
- Why did my file become corrupted?
- Common causes are a crash or power loss while the file was being saved, an interrupted copy or download, removing a USB drive without ejecting it, and a failing disk. Word also lists damage to the document or its template as a cause of documents that will not open.
- Should I run sfc /scannow for a corrupted document?
- No. System File Checker only verifies and repairs protected Windows system files. Use it when Windows itself or a built-in program misbehaves, not for your own documents, photos or archives.