Does not rely on file extensions. Uses a trainable definitions database rather than hardcoded rules. Can identify thousands of file formats. Supports batch scanning and CSV output.
Notes
Requires triddefs.trd definitions file in the same directory. Definitions can be updated with -u flag. Built on Python internally.
Version
Latest known: 2.47
Try it
Identify a file by binary signature
Run trid against a sample fixture and have the wrapper's identifyFile() helper parse the matches into a {probability, extension, typeName} triple per definition. The Result panel surfaces the highest-probability primary extension/type, the unique extension list, and the per-match triples; the raw EXE text is shown below for reference. Pick any of the binary fixtures (jpg, png, gif, mp3, zip, xlsx) to see different match sets.
Show extended definition info
Calls identifyFile(verbose=true) which adds -v to the trid invocation. Each match in the Result panel then carries mimeType and relatedURL fields parsed from the EXE's 'Mime type:' / 'Related URL:' rows. Try it against the various PDF fixtures - all match the PDF definition but the relative confidence shifts based on which PDF features are present.
# TrID - Help
Source: https://mark0.net/soft-trid-e.html
```
TrID - File Identifier v2.47 - (C) 2003-2025 By Marco Pontello
usage: trid [-h] [-ae | -ce] [-r] [-d TRDFILE] [-ns] [-n RESNUM] [-e] [-w]
[-u] [-f FILELIST] [-o OUTFILE] [-v]
[files ...]
Identifies the type of a file based on a library of filetypes definitions
positional arguments:
files files to scan (can include path & wildcards; quote
patterns like '*' to prevent shell expansion)
options:
-h, --help show this help message and exit
-ae, --add-ext add guessed extension to filenames
-ce, --change-ext change filenames extensions
-r, --recursive recursively include files in subdirectories
-d TRDFILE use specified defs package
-ns, --no-strings disable strings check
-n RESNUM show the first RESNUM matches
-e, --extended-info show more info from the matching definition
-w, --wait wait a key at the end
-u, --update update defs package and exit
-f, --file-list FILELIST
specify a text file containing a list of files to scan
(use - to read from stdin)
-o, --out OUTFILE create a CSV file with the results
-v, --version show program version, platform, licenses and exit
```