Renamed a file and now it’ll not open?

Changing a file extension doesn’t change what is inside. Why renamed files break, how to find out what a file really is and how to convert it properly.

Last updated

A form wanted a JPG, you had a HEIC, so you changed the name to photo.jpg. Now the form still rejects it and your photo viewer can’t open it either. Nothing is broken; the file is exactly what it always was.

What an extension actually does

The extension, the .jpg or .pdf at the end of a name, is a label. Your computer uses it to decide which program to open the file with. It doesn’t describe what is inside and changing it doesn’t change a single byte of the contents.

Inside, nearly every file format starts with its own signature: a few fixed bytes that the program reading it checks first. A PNG always starts the same way, a PDF starts with %PDF, a zip starts with PK. When a JPG viewer opens a renamed HEIC, it finds a HEIC signature where a JPG one should be and gives up. Upload forms increasingly check the signature too, which is why renaming doesn’t fool them.

Finding out what a file really is

The file type checker reads the start of any file and compares it with around fifty signatures. It tells you what the file actually is and whether the name matches and it can look inside a zip to tell a Word document from a spreadsheet or an e-book. If the name is wrong, it offers a copy with the right one.

It reads only the first and last few kilobytes, so a large video is checked as quickly as a small photo.

Renaming back or converting properly

If the file just has the wrong name, renaming it back is the whole fix. If you need a different format, convert it: that rewrites the contents into the new format. For photos, the image converter does it; for an iPhone photo in particular, see why HEIC files won’t open on Windows. For spreadsheets, see how to open an .xls without Excel.

When the name hides something worse

Because Windows hides known extensions, a file named statement.pdf.exe appears as statement.pdf with a program’s icon. Opening it runs the program. If the checker reports that a document is really a program, don’t open it. It isn’t an antivirus scan, but a disguised program is a clear reason to delete the file.

Common questions

Does renaming a file convert it?

No. The extension is only a label that tells your computer which program to use. Changing .heic to .jpg leaves a HEIC file with a misleading name, which JPG programs then fail to open and upload forms reject.

Why can I not see the extension on Windows?

Windows hides extensions for known file types by default, so photo.jpg shows as photo. In File Explorer, turn on File name extensions under the View menu to see them, which also makes a renamed or disguised file much easier to spot.

How do I fix a file with the wrong extension?

Rename it back to its real extension, which the file type checker tells you. If you actually need a different format, convert it with a tool that rewrites the contents.

Can a file pretend to be something it isn’t?

Yes. A classic trick is a program named invoice.pdf.exe, which shows as invoice.pdf when extensions are hidden. The file type checker reports programs clearly whatever they’re called.

Tools for this

More guides