What is a file extension?
A file extension is the short tag at the end of a filename, after the final dot — the docx in report.docx or the jpg in cat.jpg. It tells your computer which program should open the file.
What it actually does
The extension is a label, not the content. Your operating system keeps a list matching extensions to programs: .pdf opens in your PDF reader, .mp3 in your music player. Change the label and the computer will try the wrong program — the file itself hasn't changed at all.
Why you sometimes can't see it
Windows and macOS hide extensions by default to keep filenames tidy. To show them:
- Windows 11: open File Explorer, click View → Show → File name extensions.
- macOS: Finder → Settings → Advanced → tick "Show all filename extensions".
Hidden extensions are also a security trap: invoice.pdf.exe looks like a PDF when extensions are hidden, but it's a program.
Can I just rename it?
Sometimes. Renaming works when the file really is that format and was simply mislabelled — for instance a .bak backup renamed back to .docx. It won't work as a conversion: renaming a .png to .jpg doesn't re-encode anything, it just misleads the software. Always work on a copy.
One extension, several formats
Extensions aren't reserved or registered by anyone, so different programs have reused the same three letters over the decades. That's why .dat could be almost anything, and why our extension pages list every format known to use a given extension.