Dictionary

What Is The File Type?

The File Type names the format of a file, such as JPEG, MP3, or PDF. It comes mainly from the first bytes of the file, not only from the file name.

file-type

The file type tells you what kind of file you have, such as a JPEG image or a PDF document. It names the format, which sets how the data inside the file is arranged.

In a metadata report, the File Type field shows this format as a short name, such as JPEG or PDF. The value comes mainly from the file content, so it can differ from the file name extension.

What the value looks like

File Type is a short name. For many formats, it is the file name extension in uppercase.

  • PNG for a PNG image
  • MP4 for MP4 video
  • PDF for a PDF document
  • JPEG for a JPG photo, whether the name ends in .jpg, .jpeg, or .jpe
  • TIFF for an image whose name ends in .tif or .tiff

Some file types share one basic structure. MP4 video, M4A audio, and HEIC images are based on the QuickTime format.

WAV audio and WebP images are based on a structure called RIFF. File Type still names the specific type, such as MP4 or WAV.

File Type is the basis for 2 related fields, File Type Extension and MIME Type. For a JPEG file, these fields show jpg and image/jpeg. For audio and video files, the ffprobe program also reports the container format as Format Name.

Where the value comes from

No camera or program writes File Type into a file, and you cannot edit the value. The metadata reader ExifTool generates File Type when it reads the file.

ExifTool first tries the format that the extension suggests. It checks whether the file starts with the fixed pattern of bytes that this format uses. If the bytes do not match, ExifTool tests the other formats it knows.

This pattern is often called a magic number or a signature. A JPEG file starts with the bytes FF D8 FF, and a PNG file starts with 89 50 4E 47. The raw header shows these first bytes.

When no format matches, ExifTool shows an error instead of a File Type, for example:

  • File format error if ExifTool knows the extension, such as .jpg
  • Unknown file type if the extension is unknown or missing
  • File is empty if the file has no data

File type and extension are not the same

The extension is the end of the file name, such as .jpg in photo.jpg. On Windows, the extension tells your computer which program opens the file and which icon to show.

Anyone can change an extension, but that does not change the data inside the file. Renaming photo.jpg to photo.png does not turn the photo into a PNG image.

Because ExifTool reads the first bytes, File Type can show the real format. If a file named photo.png shows JPEG, the file is a JPEG image with the wrong extension.

Some formats have no magic number, so this check does not work for every file. Within one family, such as TIFF-based raw formats, the extension can still decide the specific type.

How to find out what kind of file you have

  • Check the extension. In Windows 11 File Explorer, select View, then Show, then File name extensions. In Windows 10, select the File name extensions box on the View tab.
  • Read the File Type field in the file's metadata.
  • On Linux, run the file command. It runs 3 sets of tests and prints the type from the first test that succeeds.

Why it matters

When the extension does not match the file type, your computer may choose the wrong program. Web browsers use the MIME type from the web server, not the extension, to decide how to handle a file.