AI & Agents

ExifTool Tutorial: A Practical Guide to Reading, Writing, and Batch Processing Metadata

ExifTool is a free, open-source command-line application for reading, writing, and editing metadata in image, audio, video, and document files across hundreds of formats. This guide covers installation, core commands, batch workflows, conditional processing, and practical examples that go well beyond the basics most tutorials stop at.

Fast.io Editorial Team 12 min read
Metadata audit interface showing structured data extracted from files

What ExifTool Is and Why It Matters

ExifTool is a Perl-based command-line tool created by Phil Harvey that reads, writes, and edits metadata across more than 400 file formats. It recognizes tens of thousands of individual metadata tags spanning EXIF, IPTC, XMP, GPS, ICC Profile, MakerNotes, and dozens of other tag groups. The current release as of April 2026 is version 13.57.

Unlike GUI-based metadata editors that handle a handful of common tags, ExifTool gives you direct access to every metadata field a file contains. Photographers use it to organize shoots by date, forensic analysts use it to verify file provenance, and developers build it into automated pipelines for metadata extraction at scale.

The tool runs on Windows, macOS, and Linux with no external dependencies beyond Perl (which ships with macOS and most Linux distributions). It is completely free, actively maintained, and has been the de facto standard for metadata manipulation since its first release in 2003.

Three things set ExifTool apart from alternatives:

  • It supports more file formats than any competing tool, including RAW formats from every major camera manufacturer, video containers like MP4 and MOV, audio files, PDFs, and Office documents.
  • It handles both reading and writing, so you can extract metadata, modify it, copy it between files, and strip it entirely.
  • It processes files non-destructively by default, creating backup copies before any write operation.

Installing ExifTool

ExifTool installation varies slightly by operating system, but none of the options require more than a few minutes.

Windows

Download the Windows executable package from the official ExifTool website. The download is a standalone .exe that includes Perl, so there is nothing else to install. Unzip the archive and rename exiftool(-k).exe to exiftool.exe. Move it to a directory in your system PATH (like C:\Windows) or add its location to PATH manually.

To verify the installation, open a command prompt and run:

exiftool -ver

You should see the version number (e.g., 13.57).

macOS

Download the .pkg installer from the ExifTool website. Double-click to install. The package places the exiftool binary in /usr/local/bin, which is already in your PATH on most macOS configurations.

Alternatively, install via Homebrew:

brew install exiftool

Linux

Most Linux distributions include ExifTool in their package managers:

sudo apt install libimage-exiftool-perl    # Debian/Ubuntu
sudo dnf install perl-Image-ExifTool       # Fedora/RHEL
sudo pacman -S perl-image-exiftool         # Arch

You can also download the distribution tarball from the official site and run the exiftool script directly, since Perl is pre-installed on virtually all Linux systems.

Reading Metadata

The most basic ExifTool operation is reading metadata from a file. Point the command at any supported file and it dumps everything it finds:

exiftool photo.jpg

This outputs every readable tag in a human-friendly format with tag descriptions on the left and values on the right. A typical JPEG from a smartphone might return 80 to 150 lines covering camera model, lens info, GPS coordinates, timestamps, color space, and more.

Controlling Output Format

The default output uses descriptive tag names like "Date/Time Original." If you need the actual tag names for scripting, add the -s flag:

exiftool -s photo.jpg

This outputs DateTimeOriginal instead of Date/Time Original, which is what you need when writing values back.

To see which metadata group each tag belongs to (EXIF, IPTC, XMP, etc.), add -G:

exiftool -s -G photo.jpg

Extracting Specific Tags

You rarely need every tag. Pull just the ones you care about by naming them:

exiftool -DateTimeOriginal -GPSLatitude -GPSLongitude -Model photo.jpg

Structured Output for Scripting

ExifTool can output metadata as JSON or CSV, which makes it straightforward to feed results into other tools:

exiftool -json photo.jpg > metadata.json
exiftool -csv *.jpg > all_metadata.csv

The JSON output produces an array of objects (one per file), and the CSV output creates a header row followed by one row per file. Both formats work well for importing into databases, spreadsheets, or custom processing scripts.

Reading Recursively

To read metadata from every file in a directory tree, add -r:

exiftool -r -csv /path/to/photos/ > catalog.csv

This scans all subdirectories and produces a single CSV with metadata from every supported file it finds.

File indexing and metadata extraction workflow

Writing, Editing, and Deleting Metadata

ExifTool writes metadata using the same tag names you see when reading. The syntax is -TagName="value":

exiftool -Artist="Jane Smith" -Copyright="2026 Jane Smith" photo.jpg

This writes the Artist and Copyright tags into the file. ExifTool automatically creates a backup of the original file with _original appended to the filename. Once you have verified the change is correct, you can delete the backup or use -overwrite_original to skip backup creation entirely.

Editing Dates

Date manipulation is one of the most common ExifTool tasks. Shift all date tags forward by one hour:

exiftool -AllDates+=1 photo.jpg

Set a specific date:

exiftool -DateTimeOriginal="2026:03:15 14:30:00" photo.jpg

The AllDates shortcut targets DateTimeOriginal, CreateDate, and ModifyDate simultaneously, which saves you from writing three separate commands when correcting timezone errors from a camera that was set wrong.

Deleting Metadata Strip all metadata from a file:

exiftool -all= photo.jpg

This removes every writable tag. The file itself remains intact, but all embedded metadata is gone. This is the standard approach for privacy-sensitive workflows where you need to remove GPS coordinates, device serial numbers, and other identifying information before sharing files.

To remove only specific tags while keeping everything else:

exiftool -GPSLatitude= -GPSLongitude= -GPSAltitude= photo.jpg

To strip all metadata but preserve certain tags:

exiftool -all= --jfif:all photo.jpg

The double dash (--) excludes a tag group from the operation, so this removes everything except JFIF tags.

Copying Tags Between Files

The -TagsFromFile option copies metadata from one file to another:

exiftool -TagsFromFile source.jpg -all:all target.jpg

This is useful when you have edited a photo in software that strips metadata. You can restore the original metadata from the unedited file. You can also be selective about which tags to copy:

exiftool -TagsFromFile source.jpg -EXIF:all -IPTC:all target.jpg
Fastio features

Manage File Metadata at Scale Without Scripts

Fast.io Metadata Views extract structured data from documents, images, and presentations using AI. No ExifTool scripting required. Free plan includes 50GB storage and 5,000 credits per month.

Batch Processing and File Organization

ExifTool's real power shows up when you need to process hundreds or thousands of files at once. Every command that works on a single file also works on directories, glob patterns, and recursive trees.

Processing All Files in a Directory

Apply an operation to every JPEG in a folder:

exiftool -Artist="Studio Name" -Copyright="2026" *.jpg

Process multiple formats at once:

exiftool -Artist="Studio Name" -ext jpg -ext png -ext tiff /path/to/folder/

The -ext flag filters by file extension, so ExifTool skips any files that do not match.

Recursive Processing

Add -r to process an entire directory tree:

exiftool -r -Artist="Studio Name" -ext jpg /path/to/archive/

Renaming Files by Date

One of ExifTool's most popular batch operations is renaming files based on their creation date. This is far more reliable than filesystem timestamps, which change when files are copied:

exiftool '-FileName<CreateDate' -d "%Y%m%d_%H%M%S%%-c.%%le" *.jpg

This renames each file to a pattern like 20260315_143022.jpg. The %%-c adds a copy number if two files share the same timestamp, and %%le preserves the original extension in lowercase.

Organizing Files into Date Folders

Move files into a year/month directory structure based on when they were taken:

exiftool '-Directory<CreateDate' -d "/photos/sorted/%Y/%Y-%m" -r /photos/unsorted/

A photo taken on March 15, 2026 would be moved to /photos/sorted/2026/2026-03/. This single command can organize an entire photo library in seconds.

To copy files instead of moving them, add -o .:

exiftool -o . '-Directory<CreateDate' -d "/photos/sorted/%Y/%Y-%m" -r /photos/unsorted/

Importing Metadata from CSV

For bulk metadata updates, prepare a CSV file with a SourceFile column and tag columns, then import it:

exiftool -csv=metadata.csv /path/to/files/

Each row in the CSV updates the corresponding file. This is the fast way to apply metadata from a spreadsheet or database to a large collection of files.

Performance with -stay_open

When processing large batches through a script, the overhead of loading Perl and ExifTool's tag tables for every single command adds up. The -stay_open flag keeps ExifTool running as a persistent process:

exiftool -stay_open True -@ argfile.txt

Write commands to argfile.txt (one argument per line, with -execute between commands), and ExifTool processes them without restarting. This can be an order of magnitude faster for pipelines that process thousands of files.

Conditional Processing and Advanced Features

Most ExifTool tutorials stop at basic read/write commands. The conditional processing features are where ExifTool becomes a serious automation tool.

The -if Flag

The -if option evaluates a Perl expression before processing each file. Only files where the expression returns true are affected:

exiftool -DateTimeOriginal -if '$Make eq "Canon"' -r /photos/

This extracts the creation date only from Canon camera files, skipping everything else. The $ prefix references tag values within the expression.

More examples of conditional logic:

exiftool -AllDates+=1 -if '$CreateDate ge "2026:04:01"' -r /photos/

This shifts dates forward by one hour, but only for files created on or after April 1, 2026. Useful for correcting timezone errors that only affected part of a trip.

exiftool -GPSLatitude= -GPSLongitude= -if '$GPSLatitude' *.jpg

This strips GPS data, but only from files that actually have GPS tags. Files without GPS data are left untouched.

Combining Conditions

Chain conditions with Perl logical operators:

exiftool -json -if '$ImageWidth > 3000 and $Make eq "Sony"' -r /photos/

This exports metadata as JSON, but only for high-resolution Sony images.

Extracting Embedded Previews

Many RAW files contain embedded JPEG previews. Extract them as separate files:

exiftool -b -PreviewImage -w _preview.jpg -ext cr2 -r /raw/

The -b flag outputs binary data, and -w writes it to a new file with the specified suffix. This processes every CR2 file recursively and creates a JPEG preview alongside each one.

Working with Video Metadata

ExifTool reads and writes metadata in MP4, MOV, AVI, and other video containers. The commands work the same way as with images:

exiftool -Author="Production Team" -Copyright="2026" video.mp4

Read QuickTime-specific tags from a video file:

exiftool -G -s -QuickTime:all video.mov

Shift video creation dates (useful when camera timezone was wrong):

exiftool -QuickTime:CreateDate+=5 -QuickTime:ModifyDate+=5 video.mp4

ExifTool can also read timed metadata like GPS tracks from video files, which is valuable for drone footage and action camera recordings where location data is embedded as a continuous stream rather than a single coordinate.

Generating Reports with RDF/XML

For archival or compliance workflows that need structured metadata reports, ExifTool can produce RDF/XML output:

exiftool -X -r /archive/ > metadata_report.xml

This creates a standards-compliant XML document with every metadata field from every file in the archive tree.

Audit log showing metadata operations and file processing history

Building Metadata into Cloud Workflows

ExifTool works well as a local command-line tool, but most teams eventually need to extract and manage metadata at scale, across distributed teams and automated pipelines. That is where cloud-based metadata workflows come in.

Common Pipeline Patterns

A typical metadata pipeline using ExifTool looks like this:

  1. Files arrive in a staging directory (via upload, sync, or webhook trigger).
  2. A script runs ExifTool to extract metadata as JSON or CSV.
  3. The extracted metadata is loaded into a database or search index.
  4. Files are renamed, organized, or tagged based on the extracted values.

This works for small teams, but it requires maintaining the script, the server it runs on, and the database. As file volumes grow, you also need to handle concurrency, error recovery, and access control.

Cloud Alternatives for Metadata Extraction

Several platforms handle metadata extraction without requiring you to build and maintain your own pipeline:

  • Local ExifTool scripts remain the best option for photographers and individual users who process files on their own machines.
  • AWS Lambda with ExifTool works for teams that already run infrastructure on AWS, though packaging Perl in a Lambda function requires some setup.
  • Google Cloud Functions offer a similar approach with the same packaging complexity.
  • Fast.io Metadata Views take a different approach entirely. Instead of running extraction scripts, you describe the fields you want in natural language, and the platform uses AI to design a typed schema and extract values from your files automatically. This works with PDFs, images, Word documents, spreadsheets, presentations, and scanned pages. You get a sortable, filterable spreadsheet view of your metadata without writing any code or managing any infrastructure. Agents can also create Views and query results programmatically through the Fast.io MCP server. Learn more at the Metadata Views product page.

When to Use ExifTool vs. Cloud Extraction

ExifTool is the right tool when you need fine-grained control over specific EXIF, IPTC, or XMP tags, especially for photography workflows where you are working with camera-specific MakerNotes or precise GPS data. It is also the right choice for forensic work where you need to verify that metadata has not been altered.

Cloud extraction tools like Fast.io Metadata Views are better when you need to extract structured data from diverse document types (contracts, invoices, presentations), when non-technical team members need access to the results, or when you want to add new extraction fields without rewriting scripts. The two approaches complement each other: use ExifTool for precision metadata work on images and video, and cloud extraction for document-scale metadata management across a team.

Frequently Asked Questions

How do I extract metadata using ExifTool?

Run `exiftool filename.jpg` to display all metadata. For specific tags, name them directly: `exiftool -DateTimeOriginal -GPSLatitude filename.jpg`. For machine-readable output, add `-json` or `-csv` to get structured data you can pipe into other tools.

What is the ExifTool command to remove all metadata?

Run `exiftool -all= filename.jpg` to strip every writable metadata tag from a file. ExifTool creates a backup with `_original` appended by default. To remove metadata without creating a backup, add `-overwrite_original`. To strip only GPS data while keeping everything else, use `exiftool -GPS*= filename.jpg`.

Can ExifTool edit metadata in video files?

Yes. ExifTool reads and writes metadata in MP4, MOV, AVI, and other video containers. The syntax is identical to image files: `exiftool -Author="Name" video.mp4`. For QuickTime-specific tags in MP4/MOV files, prefix with the group name: `exiftool -QuickTime:CreateDate="2026:01:15 10:00:00" video.mp4`. ExifTool can also read timed GPS metadata from drone and action camera footage.

How do I batch process photos with ExifTool?

Point ExifTool at a directory instead of a single file: `exiftool -Artist="Name" /path/to/folder/`. Add `-r` for recursive processing and `-ext jpg` to filter by file type. For large batches, use `-stay_open True -@ argfile.txt` to keep ExifTool running as a persistent process, which avoids reloading Perl for each command and can be ten times faster.

How do I rename photos by date with ExifTool?

Use the FileName tag with a date format: `exiftool '-FileName<CreateDate' -d "%Y%m%d_%H%M%S%%-c.%%le" *.jpg`. This renames each file to its creation date (like 20260315_143022.jpg), adds a copy number for duplicates, and preserves the original extension. Replace `FileName` with `Directory` to move files into date-based folders instead.

What file formats does ExifTool support?

ExifTool supports reading, writing, or creating metadata in over 400 file formats. This includes JPEG, PNG, TIFF, RAW formats from every major camera manufacturer (CR2, CR3, NEF, ARW, DNG, and more), video formats (MP4, MOV, AVI, MKV), audio files (MP3, WAV, FLAC), PDFs, and Microsoft Office documents. The full list is maintained on the official ExifTool website.

Is ExifTool safe to use on original files?

Yes. ExifTool creates a backup copy of every file it modifies, appending `_original` to the filename. The original data is preserved until you explicitly delete the backup. You can disable this with `-overwrite_original`, but only do so after you have verified your commands produce the expected results on test files first.

Related Resources

Fastio features

Manage File Metadata at Scale Without Scripts

Fast.io Metadata Views extract structured data from documents, images, and presentations using AI. No ExifTool scripting required. Free plan includes 50GB storage and 5,000 credits per month.