What is the difference between a file extension and a file type?

In simple terms, a file extension is a label used to identify a file type, while the file type refers to the type of data a file contains.

A file extension is the suffix at the end of a filename, such as .jpg, .png, or .txt). The operating system uses the file extension to determine what program should open the file. While both Windows and macOS hide file extensions by default, you can show file extensions on your system. The file extension can help you determine the format of a specific file without opening it or even looking at the icon.

A file type (or file format) refers to the type of contents a file contains. It defines how data is structured within the file, such as what the file header looks like and whether the format stores information as binary or plain text data.

File extensions and file types in Windows 11

In many cases, the file extension and format are similar. In the example above, the JPEG file has a .jpg extension, and the PNG file has a .png extension. The text document isn't quite as obvious, but the .txt extension indicates it is a plain text file, rather than a Microsoft Word (.docx) file or other document.

NOTE: Since the operating system uses file extensions to identify file types, it's best not to manually change a file's extension. For example, if you change a .png extension to .jpg, you're altering the file extension but not the file type. If a file has an incorrect file extension, the app trying to open the file may produce an error saying the file type is not recognized.