Renaming a File Extension Doesn't Convert It. Here's Why
By Ismail, Founder of Filoshi
Changing photo.heic to photo.jpg doesn't make it a JPEG. What an extension is, how programs really recognize formats, and what a real conversion changes.
The extension is a label that Windows reads. The format is how the bytes inside the file are laid out. Renaming photo.heic to photo.jpg changes the label only, so the file is still a HEIC and the programs that cannot read HEIC still cannot read it. A real conversion decodes the data and writes it again in the new format.
What an extension does on Windows
An extension is the part of a file name after the last dot. Windows uses it to choose the default app that opens the file and the icon that represents it. Microsoft lists the common ones on its page about common file name extensions in Windows.
That is all it does. The extension does not change a single byte of the file's contents. It is a hint to the operating system, and it is easy to get wrong, by accident or on purpose. Windows hides extensions for known file types by default, which is why many people never see what they are renaming. To show them in File Explorer on Windows 11, open View, then Show, and tick File name extensions.
How programs really recognize a file
Most formats start with a recognizable pattern of bytes, often called a file signature or magic number. A program that wants to be sure reads the first bytes and compares them with what it expects. Some well-known examples:
| Format | Starts with (hex or text) |
|---|---|
| JPEG | FF D8 FF |
| PNG | 89 50 4E 47 (then 0D 0A 1A 0A) |
| ZIP | PK (50 4B) |
%PDF |
The PNG signature is defined in the PNG specification. The ZIP header comes from PKWARE's APPNOTE. Gary Kessler keeps a long public list of file signatures if you want to look up others. JPEG itself is described by the committee at jpeg.org, and the common JFIF file wrapper is documented by the Library of Congress.
You can see the signature yourself. Open a file in a hex viewer, or in a plain text editor, and look at the first few characters. A PDF starts with the text %PDF. A renamed PDF still does.
Why renaming sometimes seems to work
People rename files because sometimes it works. There are two honest reasons for that.
Many programs sniff the content. A web browser or an image viewer often ignores the extension and looks at the signature. If you rename a PNG to .jpg, a browser may still show it, because it recognized the PNG data. The label was wrong, and the program worked around it.
Some formats are relatives. A DOCX file is a ZIP package that holds XML parts, as defined in ECMA-376. Rename it to .zip and you can open it as an archive and see the pieces. That works because it truly is a ZIP package, not because the extension changed what it is. MP4, M4A and MOV are also close relatives: they belong to the same family of container layouts built on the ISO base media file format, so some tools handle them interchangeably. Close is not identical, though.
Renames that are safe, and renames that break things
A rename is safe when both names describe the same format:
.jpegand.jpg.tifand.tiff.htmand.html.ymland.yaml
The old three-letter limit is the only reason these pairs exist. The content is the same either way.
A rename breaks things when the formats differ:
- HEIC to JPG. Programs that cannot read HEIC still cannot read it, now with a misleading name.
- WebP to PNG. A program that trusts the extension will fail or show an error. Converting properly is the fix; see WebP to JPG.
- MKV to MP4. Sometimes it plays, often it does not. Either the player sniffs the content and copes, or it follows the extension and fails. The right way is MKV to MP4.
There is a more dangerous version of this: an upload form that checks the extension and then your program that reads the content. Mismatches between the two are a classic source of bugs, which is one more reason to avoid casual renaming.
What a real conversion does
A conversion has two steps. The converter decodes the original into raw pixels, samples or text. Then it encodes that data into the new format. That is why it can take time and why the result has its own file size, quality and features.
The encode step is where quality can be lost. Going from a lossless source to a lossy format throws away detail. Going from lossy to lossy compresses twice. Converting to a lossless format keeps what is there but cannot restore what was already gone. I explain this in Lossy vs lossless compression. For instance, PNG to JPG shrinks a file by discarding detail, and M4A to MP3 re-encodes the audio.
Filoshi follows the same two steps. It decodes with the matching engine (ImageMagick, FFmpeg, Pandoc and others, as described in how the engines work) and writes a new file next to the original. It never renames the original. I have not tested whether it detects mislabeled files by their content, so do not count on it to fix a wrong extension.
I make Filoshi, so weigh my take on it accordingly.
Show extensions, spot fakes
Turn extensions on. It takes a few seconds and solves two problems. You see what you are really renaming, and you can spot a fake. A file called invoice.pdf.exe shows as invoice.pdf when extensions are hidden, with a PDF-looking name but an executable's behavior. With extensions visible, you see the last part, .exe, and you know it is a program.
The last extension is the one that counts. If you see two, read the final one. If a document or photo ends in .exe, .scr, .bat or similar, do not open it. For the full routine for new downloads, see What SmartScreen means, and for open-failure diagnosis start at Why won't my file open on Windows?
Frequently asked questions
Is .jpg the same as .jpeg?
Yes. Both extensions name the same JPEG format. The three-letter .jpg exists because older Windows versions limited extensions to three characters. You can rename between them safely, and every program that reads one reads the other.
Why is a .docx really a ZIP file?
A DOCX is a package: a ZIP container that holds the document's XML text, styles and media as separate parts. The Office Open XML standard (ECMA-376) defines it that way. Rename a copy to .zip and you can open it and see the parts, but edit it in Word, not in the archive.
I renamed a file and now it won't open. How do I undo it?
Rename it back to the original extension. If you do not remember it, look at the first bytes of the file with a hex viewer and compare them with a signature list, or open the file in a program that detects content. Then rename it correctly, and convert it if you need a different format.
Can a fake extension hide malware?
Yes. A program can be named to look like a document, and Windows hides known extensions by default, so report.pdf.exe appears as report.pdf. Turn on file name extensions, check the last part of the name, and never open an unexpected file that ends in a program extension.
What Is AVIF? The Image Format After WebP, Explained
Next →"Windows Protected Your PC": What SmartScreen Means
Ready to convert files privately?
1,841 tested conversions. No uploads. No accounts. Runs entirely on your machine.
Get Filoshi · $29