Back to blog

ExifTool: The Swiss Army Knife of Metadata

9 min
ExifTool: The Swiss Army Knife of Metadata

Introduction

Have you ever wondered what hidden information your files carry? A photo taken with your phone silently stores the exact GPS coordinates where it was captured, your device model, the precise time, and even a unique identifier from the camera sensor. A PDF generated in Word saves the author's name, the company, how many times it was edited and with which software version. A video recorded with your camera includes codec settings, lens information and geolocation data.

Most of the time this metadata is invisible, but it's there. It can be a privacy issue when you share files publicly, or a powerful tool when you need to organize, catalog or audit large volumes of files.

ExifTool is a command-line tool created by Phil Harvey, written in Perl, that has become the de facto standard for manipulating metadata. It supports over 400 file formats and can read and write EXIF, IPTC, XMP, ID3, ICC, JFIF, GeoTIFF, PDF metadata, and many more. Many popular graphical applications like digiKam, XnView or Lightroom use it internally.

In this article we'll explore ExifTool in depth: from the basics to advanced use cases with images, videos, PDFs and office documents.

Installation

Depending on your operating system, installation is pretty straightforward:

# macOS
brew install exiftool

# Linux (Debian/Ubuntu)
sudo apt install libimage-exiftool-perl

# Arch Linux
sudo pacman -S perl-image-exiftool

# Windows (Chocolatey)
choco install exiftool

To verify everything is in order:

exiftool -ver

If it returns a version number, you're good to go.

What types of metadata exist?

Before diving into the commands, it's useful to understand what we're working with:

  • EXIF (Exchangeable Image File Format): Technical camera data — aperture, ISO, shutter speed, GPS, device model. Present in JPEG, TIFF and some RAW formats.
  • IPTC (International Press Telecommunications Council): Editorial metadata — title, description, credits, keywords. Widely used in professional photography and news agencies.
  • XMP (Extensible Metadata Platform): Adobe's XML-based format. It can store virtually any type of metadata and is embedded in many formats.
  • ID3: Audio file metadata — artist, album, year, genre, cover art.
  • PDF Info: Author, title, creator, creation date, software version.

The interesting thing about ExifTool is that it handles all these formats with the same syntax. You don't need to learn different commands for each file type.

Working with images

This is probably the most common use case. Let's see what we can do.

Reading metadata

To view all metadata from an image:

exiftool photo.jpg

The output can be quite extensive, especially with RAW files. If you only care about specific fields:

exiftool -Model -LensModel -FocalLength -ISO -ShutterSpeed photo.jpg
Camera Model Name               : Canon EOS R6
Lens Model                      : RF 50mm F1.8 STM
Focal Length                     : 50.0 mm
ISO                             : 400
Shutter Speed                   : 1/200

You can also filter by metadata group:

# EXIF data only
exiftool -EXIF:all photo.jpg

# GPS data only
exiftool -GPS* photo.jpg

# XMP data only
exiftool -XMP:all photo.jpg

Writing metadata

# Change the author
exiftool -Author="Your Name" photo.jpg

# Add title and description
exiftool -Title="Sunset at the beach" -Description="Puerto Vallarta, 2026" photo.jpg

# Add keywords
exiftool -Keywords="landscape" -Keywords="sunset" -Keywords="beach" photo.jpg

# Add GPS coordinates
exiftool -GPSLatitude=20.6534 -GPSLatitudeRef=N -GPSLongitude=-105.2253 -GPSLongitudeRef=W photo.jpg

# Copyright
exiftool -Copyright="© 2026 Your Name. All rights reserved." photo.jpg

Fixing dates

If your camera had the wrong time set, you can fix all photos in one go:

# Add 2 hours to all dates
exiftool -AllDates+=2:00 photo.jpg

# Subtract 5 hours and 30 minutes
exiftool -AllDates-=5:30 photo.jpg

# Set a specific date
exiftool -DateTimeOriginal="2026:01:15 14:30:00" photo.jpg

Removing metadata

# Remove all metadata
exiftool -all= photo.jpg

# Remove GPS data only
exiftool -GPS*= photo.jpg

# Remove everything except orientation (so it doesn't display rotated)
exiftool -all= -TagsFromFile @ -Orientation photo.jpg

# Remove everything except orientation and color profile
exiftool -all= -TagsFromFile @ -Orientation -ColorSpaceTags photo.jpg

Working with PDFs

PDFs are one of the formats where metadata goes most unnoticed, and where it can pose a significant privacy risk. A PDF can reveal who created it, with what software, when it was modified, and even the operating system username.

Reading PDF metadata

exiftool document.pdf
File Name                       : document.pdf
Title                           : Quarterly Report Q1
Author                          : John Smith
Creator                         : Microsoft Word 2021
Producer                        : Microsoft: Print To PDF
Create Date                     : 2026:03:15 09:23:45-06:00
Modify Date                     : 2026:03:15 10:12:33-06:00
Page Count                      : 12
PDF Version                     : 1.7

See the problem? If you share that PDF publicly, anyone can know it was made by John Smith in Word 2021.

Modifying metadata

# Change the author
exiftool -Author="Finance Department" document.pdf

# Change title and subject
exiftool -Title="Public Report Q1 2026" -Subject="Financial results" document.pdf

# Change multiple fields
exiftool -Author="Name" -Creator="LaTeX" -Producer="pdfTeX" document.pdf

Removing metadata

# Remove all metadata
exiftool -all= document.pdf

# Without creating a backup file
exiftool -all= -overwrite_original document.pdf

Auditing multiple PDFs

This is very useful when you need to check what information your team's documents are exposing:

exiftool -T -FileName -Author -Creator -CreateDate *.pdf
contract.pdf    John Smith    Microsoft Word    2026:02:10 15:30:00
invoice.pdf     ERP System    wkhtmltopdf       2026:03:01 08:00:00
manual.pdf      -             LaTeX             2025:12:20 11:45:00

Working with videos

Videos usually contain information about the codec, resolution, duration, bitrate, and if recorded with a phone, also GPS data and device model.

# View all metadata
exiftool video.mp4

# Useful specific fields
exiftool -Duration -VideoFrameRate -ImageSize -CompressorName -AudioChannels video.mp4

# Remove metadata
exiftool -all= video.mp4

# Extract embedded preview image
exiftool -b -PreviewImage video.mp4 > preview.jpg

Working with audio files

ExifTool also reads and writes ID3 tags in audio files:

# Read tags
exiftool song.mp3

# Modify tags
exiftool -Artist="Artist Name" -Album="Album Name" -Year=2026 -Genre="Rock" song.mp3

# Extract embedded cover art
exiftool -b -Picture song.mp3 > cover.jpg

Working with office documents

ExifTool can read metadata from Office files (DOCX, XLSX, PPTX):

exiftool document.docx
File Name                       : document.docx
Creator                         : John Smith
Last Modified By                : Jane Doe
Revision Number                 : 15
Create Date                     : 2026:01:10 08:00:00Z
Modify Date                     : 2026:03:20 16:45:00Z
Total Edit Time                 : 4.5 hours
Pages                           : 23
Words                           : 8450
Application                     : Microsoft Office Word

This can reveal how many revisions a document had, who last edited it and how much time was spent on it. To clean them:

exiftool -all= document.docx

Batch operations

This is where ExifTool truly shines. Processing entire directories is trivial.

Processing directories

# All files in a directory
exiftool -Artist="Your Name" directory/

# Recursively
exiftool -r -Artist="Your Name" directory/

# Only certain formats
exiftool -ext jpg -ext jpeg -r -Artist="Your Name" directory/
exiftool -ext pdf -r -all= directory/

Renaming files with metadata

Rename photos using the capture date:

exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" directory/

This generates names like 2026-01-15_14-30-00.jpg. The %%-c adds a numeric suffix if there are duplicates.

Organizing into folders by date

exiftool '-Directory<DateTimeOriginal' -d "%Y/%Y-%m" directory/

Result:

2026/
├── 2026-01/
├── 2026-02/
└── 2026-03/

Organizing by file type

exiftool '-Directory<FileType' directory/
JPEG/
PDF/
MP4/
PNG/

Copying metadata between files

# Copy all metadata from one file to another
exiftool -TagsFromFile source.jpg destination.jpg

# Copy only certain fields
exiftool -TagsFromFile source.jpg -GPS* -DateTimeOriginal destination.jpg

# Copy from a template file to an entire directory
exiftool -TagsFromFile template.jpg -Author -Copyright directory/

Conditional filters

The -if option allows filtering files based on their metadata. This is very powerful:

# Photos without GPS coordinates
exiftool -r -if 'not $GPSLatitude' -FileName directory/

# Photos taken with a specific lens
exiftool -r -if '$LensModel =~ /50mm/' -FileName -LensModel directory/

# Files created after a certain date
exiftool -r -if '$CreateDate ge "2026:01:01"' -FileName directory/

# PDFs created with Word
exiftool -r -ext pdf -if '$Creator =~ /Word/' -FileName -Creator directory/

# Images with resolution greater than 4000px wide
exiftool -r -if '$ImageWidth > 4000' -FileName -ImageSize directory/

Output formats

ExifTool can export in several formats, which is useful for integrating with other tools:

# JSON (ideal for processing with jq)
exiftool -json photo.jpg
exiftool -json photo.jpg | jq '.[0].Model'

# CSV (for spreadsheets)
exiftool -csv -r -FileName -Model -CreateDate directory/ > metadata.csv

# Tabular (tab-separated)
exiftool -T -FileName -ImageSize -FileSize *.jpg

# HTML
exiftool -h photo.jpg > metadata.html

Privacy: why cleaning metadata matters

This is perhaps the most important use case and the one fewer people know about. When you upload a photo to the internet, EXIF metadata can reveal:

  • Your exact location through GPS coordinates
  • Your device — phone or camera model
  • Your name if configured on the device
  • The exact time it was taken
  • A unique identifier from your camera sensor

With PDFs and office documents the risk is similar: author name, system username, software used, revision history.

A recommended workflow before publishing files:

# Clean all images in a directory
exiftool -all= -overwrite_original web_directory/

# Clean public PDFs
exiftool -all= -overwrite_original public_documents/*.pdf

# Verify they're clean
exiftool -if '$Author or $GPSLatitude' web_directory/

If the last command produces no output, the files are clean.

Quick reference

OptionDescription
-rProcess recursively
-overwrite_originalDon't create backup files
-jsonJSON output format
-csvCSV output format
-TTab-separated output
-hHTML output
-if 'CONDITION'Filter files by condition
-ext jpgProcess only files with specific extension
-d FORMATDate format (for renaming)
-bBinary output (extract embedded images)
-TagsFromFileCopy metadata from another file
-all=Delete all metadata
-GShow group name for each tag
-vVerbose mode

Conclusion

ExifTool is one of those tools that once you know it, you can't stop using. Its versatility for working with virtually any file format makes it a fundamental piece for anyone working with digital files — whether you're a photographer organizing your library, a developer automating pipelines, or someone who simply wants to protect their privacy before sharing files online.

I invite you to explore the official documentation at exiftool.org, it's extensive and worth it. You can also check the complete list of supported tags and formats with:

# Supported tags
exiftool -list

# Supported formats
exiftool -listwf

Happy hacking!

Share

Related posts