How to Geotag Photos with ExifTool (Without the Headache)

Write GPS coordinates into any photo's EXIF with ExifTool β€” single files, GPX tracks, or a whole folder β€” and verify they landed correctly.

ExifTool is the reference tool for image metadata. Phil Harvey has maintained it since the 1990s, it's free and open-source, and it reads and writes virtually every metadata tag across hundreds of file formats. GPS lives in EXIF as two pairs of tags: GPSLatitude + GPSLatitudeRef (N or S) and GPSLongitude + GPSLongitudeRef (E or W). ExifTool writes them precisely, accepts a whole folder or a GPX track, and is fully scriptable. The trade-off is the terminal β€” and knowing the coordinates in the first place.

TL;DR: Install ExifTool, run exiftool -GPSLatitude=… -GPSLatitudeRef=N -GPSLongitude=… -GPSLongitudeRef=E photo.jpg for a file you already know the location of. For a whole trip, feed it a GPX track and let it match timestamps. Verify with exiftool -GPS:all photo.jpg. If you have photos with no GPS and no memory of where they were taken, ExifTool can't help with the discovery step β€” see the geotagging-without-GPS guide.

Install ExifTool

ExifTool is a Perl application packaged as a native binary on every major platform.

macOS (Homebrew β€” recommended):

brew install exiftool

Ubuntu / Debian:

sudo apt install libimage-exiftool-perl

Windows: Download the Windows Executable package from exiftool.org, rename exiftool(-k).exe to exiftool.exe, and place it somewhere on your PATH (e.g. C:\Windows\ or a dedicated tools folder).

Verify the install:

exiftool -ver

You should see a version number like 13.xx.

Write coordinates you know

If you know the coordinates β€” from Google Maps, a caption, a location saved elsewhere β€” write them directly with the -GPS* flags. Use decimal degrees: 48.8584 for the Eiffel Tower latitude. Get the pair by right-clicking any spot in Google Maps and copying the numbers at the top of the context menu.

exiftool -GPSLatitude=48.8584 -GPSLatitudeRef=N \
         -GPSLongitude=2.2945 -GPSLongitudeRef=E photo.jpg

The Ref tags (N, S, E, W) are required β€” without them some applications display the coordinate but won't plot it correctly on a map. ExifTool prints 1 image files updated on success.

To tag a whole folder instead of a single file, pass the directory path:

exiftool -GPSLatitude=48.8584 -GPSLatitudeRef=N \
         -GPSLongitude=2.2945 -GPSLongitudeRef=E path/to/folder/

This applies the same coordinates to every photo in the folder β€” useful when an entire shoot happened in one place.

About the backup files: ExifTool creates a .jpg_original copy of the original before writing, by default. That's your safety net. Check the tagged file, then delete the originals when satisfied. To suppress backups:

exiftool -overwrite_original -GPSLatitude=48.8584 -GPSLatitudeRef=N \
         -GPSLongitude=2.2945 -GPSLongitudeRef=E photo.jpg

Geotag from a GPX track

If you carried a GPS logger, recorded a track in a sports watch, or exported a route from a phone, ExifTool can match each photo's capture timestamp to the nearest point in the track and write the interpolated coordinates automatically.

exiftool -geotag track.gpx "-Geotime<DateTimeOriginal" *.jpg

ExifTool reads the DateTimeOriginal tag from each photo, finds the closest point in the track timeline, interpolates the position if needed, and writes the GPS tags. It processes all matching files in one pass.

The clock-sync caveat β€” this is the thing that trips people up. A GPS track records time in UTC. Your camera clock is probably set to local time, and it may have drifted during a long trip. If the timestamps don't align, the geotag will be wrong β€” or ExifTool will silently skip photos that fall outside the track's time window.

Before running on a large folder, test on one photo:

exiftool -GPS:all -DateTimeOriginal photo.jpg

Compare the DateTimeOriginal timestamp against the track in a text editor to confirm they line up. If your camera clock was two hours behind UTC, tell ExifTool the timezone by appending an offset to the Geotime tag β€” use the ${tag} form so the offset attaches to the value:

exiftool -geotag track.gpx "-Geotime<${DateTimeOriginal}-02:00" *.jpg

To widen the matching window when your track has long gaps between points:

exiftool -api GeoMaxIntSecs=7200 -geotag track.gpx "-Geotime<DateTimeOriginal" *.jpg

-api GeoMaxIntSecs=7200 widens the interpolation window to two hours (7200 seconds). The default is 1800 (30 minutes), which covers most scenarios; raise it when a track has long pauses so ExifTool still interpolates a position instead of skipping the photo. (Lowering it below 1800 does the opposite β€” it tightens the window to avoid false matches on a dense track.)

Batch from a CSV

When your source of truth is a spreadsheet β€” a scanned-film archive with manual location notes, a metadata export from another tool β€” you can geotag every photo in one command from a CSV.

Format the CSV with a SourceFile column and the EXIF tag names as column headers:

SourceFile,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef
photo_001.jpg,48.8584,N,2.2945,E
photo_002.jpg,51.5007,N,0.1246,W
photo_003.jpg,40.6892,N,74.0445,W

Then run from the folder containing the photos:

exiftool -csv=coords.csv .

ExifTool matches each SourceFile entry to the corresponding file in the current directory and writes the GPS tags. Paths in SourceFile can be absolute or relative. This is the most efficient approach for any pre-catalogued archive with coordinates already in a spreadsheet.

Verify it worked

Always verify before deleting backups or uploading:

exiftool -GPS:all photo.jpg

You should see output like:

GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Latitude                    : 48 deg 51' 30.24" N
GPS Longitude                   : 2 deg 17' 40.20" E
GPS Position                    : 48 deg 51' 30.24" N, 2 deg 17' 40.20" E

The degrees/minutes/seconds display is ExifTool rendering the internal EXIF rational format into something readable β€” this is correct. The decimal degrees you typed and the DMS shown here represent the same point. If a field is missing entirely, the write didn't succeed: double-check the command, the filename, and file write permissions.

The one thing ExifTool can't do

ExifTool is a metadata writer. It takes coordinates you give it β€” from a flag, a GPX file, or a CSV β€” and writes them to the file. It cannot look at a photo and figure out where it was taken.

For most travel photographers with a GPS-enabled camera or a GPX track from their phone, that's not a problem. But for a library of old digital shots, scanned prints, or photos from cameras that never recorded GPS, the hard part isn't writing the coordinates β€” it's knowing them.

That's a discovery problem, and no metadata tool solves it. RetroTagr approaches it from the image side: AI analyzes each photo's visual content β€” landmarks, architecture, terrain, vegetation, light angle β€” and proposes coordinates, which you review and confirm before anything is written. The export writes standard EXIF GPS, the same tags ExifTool writes. You could verify the result with exiftool -GPS:all photo.jpg afterward if you want to confirm what landed.

For the full workflow on rediscovering where old photos were taken, see geotagging old photos without GPS or how to find where a photo was taken.

Wrap-up

ExifTool is the right tool when you have coordinates to write: exact decimal degrees for a single photo, a GPX track from a GPS logger, or a CSV from a catalogued archive. It's precise, scriptable, and free β€” the friction is the terminal and the clock-sync work when using GPX tracks.

If you'd rather avoid the command line, desktop apps like digiKam and GeoSetter both use ExifTool under the hood and expose GPX geotagging through a GUI. For a browser-based path with no install, RetroTagr handles both manual map placement and AI-assisted location discovery and exports the same standard GPS EXIF. If you're weighing a desktop geotagger against a web-based one, the RetroTagr vs GeoSetter comparison lays out the differences. And if the real problem is a folder of photos with no GPS and no memory of where they were taken, the without-GPS guide is the next read.

Frequently asked questions

Related guides

Start tagging your photos

Try the AI geotagger free for the first 5 photos.

Get started
How to Geotag Photos with ExifTool (Without the Headache)