What Does Corrupt File Mean?

What you need to know about data corruption

A corrupted file is a damaged data file. The file may suddenly become inoperable or unusable. It may not open at all or return an error when opened. Sometimes it's possible to fix the file, while other times you may have to delete the file and retrieve a saved version.

There are many causes of file corruption, such as a software bug, a virus, a computer crash, or bad sectors on a hard drive. Here's a look at what data corruption means in computing, what creates the problem, and what you can do about it.

Corrupted files can occur in any software program and usually doesn't indicate a problem with the application itself. It's usually a problem unique to the file.

Horizontal pixelated rainbow stripes in a JPG file, due to file corruption.

What Is Data Corruption?

Every file has a header, sometimes called a "magic number," that tells your file system what to do with it when it's accessed. For instance, one number tells your operating system the file is an MP3 and should produce audio, while another might tell your operating system that it's a Word document that should open in a word processor. If this magic number is somehow altered, your system interprets the file as a different file type, and it won't be able to open the file.

Certain file types expect certain numbers in certain points in the file at regular intervals. For instance, in files containing text, each character is supposed to be a certain size, depending on how the text is encoded, and should start with a consistent combination of bytes every time. If this number is off, the OS might try to render an unreadable character, causing the file to become inaccessible.

Corruption occurs when the file's original byte composition is accidentally altered. While occasionally corrupted files can still be opened, usually the file is inaccessible.

Every file type has its own standard, so corruption can take on different forms and produce different outcomes. It's easy to spot a corrupted media file, such as an MP3 or password list, while other corrupted-data errors might be hard to diagnose.

How Are Files Corrupted?

There are many ways a file can become corrupted. Data corruption can occur when there's a problem during the saving process. For example, if your computer crashes while you're saving a file, there's a good chance that the file might become corrupted. A power outage can affect multiple open files.

An application might experience an error while it's saving or creating a file, corrupting the file in the process. Your browser might run into problems when you're downloading a file, resulting in file corruption. Viruses can corrupt data files, as can any interruption in normal computer processes.

Physical problems can cause data corruption, as well. For example, if a hard drive is dropped, shaken, or shifted rapidly too many times, electrical and mechanical malfunctions could result in corrupted files. A corrupted file might be a sign of a bad physical sector, which is a much larger problem.

Sometimes your application will give you an error indicating that there's been a problem, but often you'll have no idea until you try to open a file that's been corrupted.

How to Prevent File and Data Corruption

The best way to protect yourself against corrupted files is to make sure you have a good backup of all your data. It's easier to delete a corrupted file and recover that file from a recent backup than it is to repair the file.

If a file is corrupted and you have a cloud backup in place, restore the file as soon as you can, before the corrupted file is stored in the online server.

Make sure your computer has good virus and malware protection, so these bad actors can't corrupt your data in the first place.

Another idea is to invest in an uninterrupted power supply (UPS), so power outages or other glitches can't corrupt your files. A good UPS can protect your computer from hardware malfunctions as well as file corruption.

While there are tools for recovering corrupted files, their success rates vary and depend on the type of corrupted file, the state of the device's hardware and software, and many other factors.

As technology advances, file corruption is getting less common. Make sure to keep your devices well-maintained, update software appropriately, and install good virus and malware protection.