Windows – How to Determine File Type Without Extension

file extensionfile managementwindows

I sometimes get files from my clients that have the wrong file extension. For example, the name is image.jpg but the file is actually a TIFF image. In many cases I can clarify it by opening the file in a text editor, looking at the first few bytes, then deducing which file type it is.

This works for me with JPEG, TIFF, GIF and PDF files. However there are many more file types out there.

Is it possible to automate identification of the correct file type by analyzing the containing data?

Best Answer

You can use the TrID tool which has a growing library of file type definitions for identifying files with.

Screenshot

Wildcards are supported, so in your example you could just put all the images to be examined in a folder, e.g. C:\verifyimages - then you can use the command:

trid C:\verifyimages\*

This will examine all files in the verifyimages folder.


There is also a GUI version available, TrIDNet:

Screenshot

There is documentation available on how you can you can easily integrate TrID or TrIDNet into Windows Explorer and Total Commander:

Windows Explorer

Total Commander

Related Question