Skip to content

ExifTool

60 commands

Reads, writes and strips metadata in images, documents, audio and video — invaluable for OSINT and forensics.

  • metadata
  • OSINT
  • images

Install ExifTool

sudo apt install libimage-exiftool-perl

Basic ExifTool Syntax1

exiftool -ver

Displays the installed version number of the ExifTool application

Basic Metadata Inspection2

exiftool <file>

Extracts and displays all standard metadata tags found in the specified file

Link
exiftool -a <file>

Displays all metadata tags, including duplicate tags that are normally suppressed

Link

Output and Formatting Control6

exiftool -s <file>

Displays tag names and values in a short format without extra whitespace

Link
exiftool -s -s <file>

Displays tag values only, omitting the tag names entirely

Link
exiftool -j <file>

Exports the metadata output in standard JSON format

Link
exiftool -X <file>

Exports the metadata output in RDF/XML format

Link
exiftool -php <file>

Formats the output as a PHP array for web integration

Link
exiftool -T -<tag1> -<tag2> <file>

Outputs specific tags in a tab-delimited format for spreadsheet import

Link

Tag Filtering and Grouping5

exiftool -g <file>

Organizes metadata output by tag group headers like EXIF, XMP, and IPTC

Link
exiftool -G1 <file>

Displays the specific family 1 group name for each tag along with the value

Link
exiftool -H <file>

Displays the hexadecimal tag ID for each metadata tag found

Link
exiftool -D <file>

Displays the decimal tag ID for each metadata tag found

Link
exiftool -common <file>

Displays only the most common and useful metadata tags for quick triage

Link

Incident Response Investigations5

exiftool -u <file>

Extracts unknown tags that ExifTool does not recognize by name

Link
exiftool -U <file>

Extracts unknown binary tags which may contain hidden data or payloads

Link
exiftool -ee <file>

Extracts embedded metadata from video streams or document sub-files

Link
exiftool -ee3 <file>

Extracts all embedded data from video files, parsing the entire stream aggressively

Link
exiftool -warning -error -a <file>

Extracts only the warning and error messages generated during file parsing

Link

Batch Processing1

exiftool -csv <dir>

Recursively scans a directory and outputs a single CSV file with all metadata

Link

Recursive and Batch Processing3

exiftool -r <dir>

Recursively processes all files in subdirectories of the specified folder

Link
exiftool -ext <ext> -r <dir>

Processes only files with the specified extension in a directory tree

Link
exiftool --ext <ext> -r <dir>

Excludes files with the specified extension from processing

Link

Threat Hunting and Analysis4

exiftool -if '<condition>' <dir>

Processes files only if they meet a specific metadata condition

Link
exiftool -p '<string>' <file>

Prints a custom formatted string using tag values for reporting

Link
exiftool -listx

Lists all available tags in XML format including their data types

Link
exiftool -listw

Lists all Writeable tags available in the current version

Link

Metadata Editing6

exiftool -<tag>=<value> <file>

Writes a new value to the specified metadata tag

Link
exiftool -<tag>+=<value> <file>

Appends a value to a list-type tag like Keywords without overwriting

Link
exiftool -tagsfromfile <src> <dst>

Copies all metadata tags from a source file to a destination file

Link
exiftool -z -tagsfromfile <src> <dst>

Copies tags while ignoring internal compression tags to prevent corruption

Link
exiftool -overwrite_original <file>

Overwrites the original file directly instead of creating a '_original' backup

Link
exiftool -overwrite_original_in_place <file>

Overwrites the file while preserving file system attributes like creation time

Link

Metadata Removal3

exiftool -<tag>= <file>

Deletes the specific tag from the file by assigning it an empty value

Link
exiftool -all= <file>

Removes all supported metadata tags from the file for sanitization

Link
exiftool -gps:all= <file>

Removes only the GPS and geolocation tags while keeping others intact

Link

Date and Time Handling2

exiftool -alldates+=<shift> <file>

Shifts all common date/time tags forward by one hour

Link
exiftool -GlobalTimeShift <shift> <file>

Applies a global time shift to all date tags when reading or writing

Link

File Renaming2

exiftool '-filename<CreateDate' -d <fmt> <dir>

Renames files based on their creation date using a specific date format

Link
exiftool '-Directory<DateTimeOriginal' -d <fmt> <dir>

Moves files into a directory structure based on their original date year and month

Link

Digital Forensics Reporting3

exiftool -b -ThumbnailImage <file> > <out>

Extracts the binary thumbnail data from a file and saves it as a separate image

Link
exiftool -b -PreviewImage <file> > <out>

Extracts the large embedded preview image from RAW camera files

Link
exiftool -W+! <fmt> <file>

Writes extracted binary data to a file with a unique name pattern

Link

Blue Team Defensive Validation4

exiftool -v <file>

Runs in verbose mode to show the detailed parsing process of the file structure

Link
exiftool -v3 <file>

Runs in very high verbose mode, providing a hex dump of the parsed tags

Link
exiftool -htmlDump <file>

Generates an HTML file illustrating the binary structure and offsets of the metadata

Link
exiftool -validate <file>

Checks the file metadata structure for validity and potential corruption

Link

Advanced Workflows5

exiftool -@ <argfile>

Reads command-line arguments from a file to bypass shell character limits

Link
exiftool -config <cfg> <file>

Uses a custom configuration file to define user-specific tags or behaviors

Link
exiftool -api LargeFileSupport=1 <file>

Enables API support for processing files larger than 4GB

Link
exiftool -api RequestAll=2 <file>

Forces ExifTool to recognize and dump even non-standard or obscure tags

Link
exiftool -api QuickTimeUTC=1 <file>

Assumes QuickTime date tags are in UTC rather than local time

Link

Error Handling2

exiftool -m <file>

Ignores minor errors and warnings to force processing of corrupted files

Link
exiftool -F <file>

Attempts to fix the offsets of EXIF tags if they are incorrect

Link

Performance Optimization2

exiftool -fast <file>

Scans files faster by avoiding the extraction of MakerNotes

Link
exiftool -fast2 <file>

Scans even faster by avoiding any unnecessary bit-level information processing

Link

Character Encoding2

exiftool -L <file>

Assumes Latin1 encoding for tags instead of UTF-8 for legacy compatibility

Link
exiftool -charset <set> <file>

Specifies the character set to use when decoding tag values

Link

Geolocation Analysis2

exiftool -geotag <log> <dir>

Adds GPS coordinates to images by correlating time with a GPS track log

Link
exiftool -geotime=<val> <file>

Sets the GPS timestamp used for synchronization during geotagging

Link