ExifTool for GPS Tags: Read, Write, Copy and Remove
November 3, 2026
ExifTool reads and writes GPS tags from the command line. Use exiftool -gps:all photo.jpg to read them, set GPSLatitude, GPSLongitude and their Ref tags to write them, -geotag track.gpx to match a GPX log, and -gps:all= to remove them. Always test on copies first.
This guide gives you commands you can paste, explains what each part does, and covers the mistakes that cause most failed runs.
What do you need before using ExifTool for GPS tags?
You need ExifTool installed, a terminal, and a copy of your photos to practise on. ExifTool is free, open-source software by Phil Harvey. It runs on Windows, macOS and Linux.
Before you start:
- Install it. On Windows, download the executable from the ExifTool site and rename it to
exiftool.exe. On macOS, use the installer package or a package manager. Check it works withexiftool -ver. - Work on copies. By default ExifTool saves the original as
photo.jpg_originaland writes the change tophoto.jpg. That is a useful safety net. Add-overwrite_originalonly when you are sure. - Mind your quotes. On Windows Command Prompt use double quotes. On macOS and Linux, single or double quotes both work for most commands.
- Know your coordinates. You need decimal degrees (for example 40.7128, -74.0060). If you only have degrees, minutes and seconds, convert them first.
How do you read GPS tags with ExifTool?
Run exiftool -gps:all photo.jpg to list every GPS tag in the file, or name the tags you want.
exiftool -gps:all photo.jpg
exiftool -GPSLatitude -GPSLongitude -GPSAltitude photo.jpg
exiftool -n -GPSLatitude -GPSLongitude photo.jpg
The -n flag turns off print conversion, so you get plain decimal numbers (negative for south and west) instead of text like 40 deg 42' 46.08" N. That is the easiest format to paste into a map or spreadsheet.
Two more reading options help when output looks confusing:
-G1shows which group each tag comes from, such asGPSorXMP-exif. The same location can exist in more than one place.-a -G1 -sshows duplicate tags and short tag names.
If a photo returns nothing, it probably has no GPS data. See How to Check Photo Metadata on Any Device or use the free photo metadata checker to confirm without a terminal.
How do you write GPS coordinates to a photo?
Set latitude, longitude and their Ref tags together. The Ref tags hold the hemisphere: N or S for latitude, E or W for longitude.
exiftool -GPSLatitude=40.7128 -GPSLatitudeRef=N -GPSLongitude=74.0060 -GPSLongitudeRef=W photo.jpg
That places the photo in New York. Use positive numbers in the value and let the Ref tag carry the direction. This avoids the most common mistake: a photo that lands on the wrong side of the world because the Ref is missing or wrong.
To add altitude:
exiftool -GPSAltitude=25 -GPSAltitudeRef=0 photo.jpg
GPSAltitudeRef is 0 for above sea level and 1 for below. Altitude is optional, and for most business uses it does not matter.
Check the result straight away:
exiftool -n -GPSLatitude -GPSLongitude -GPSLatitudeRef -GPSLongitudeRef photo.jpg
If you want to see how each field works, EXIF Data Explained covers the basics.
How do you tag a whole folder of photos?
Point ExifTool at a folder and add -r for subfolders and -ext to limit file types.
exiftool -GPSLatitude=51.5074 -GPSLatitudeRef=N -GPSLongitude=0.1278 -GPSLongitudeRef=W -ext jpg -r job-photos/
This gives every JPG in the folder the same location, which suits a single job site or shop. Note that 0.1278 W is a deliberate example; double-check your own hemisphere.
For different locations per photo, use a CSV file. The first column must be SourceFile, and the other headers are tag names:
SourceFile,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef
job-photos/kitchen.jpg,40.7128,N,74.0060,W
job-photos/garage.jpg,34.0522,N,118.2437,W
Then import it:
exiftool -csv=coords.csv job-photos/
For more ways to tag in bulk, including without a terminal, see How to Batch Geotag Photos.
How do you geotag photos from a GPX track?
Use -geotag with your GPX file. ExifTool compares each photo's timestamp to the track points and writes the matching position.
exiftool -geotag track.gpx job-photos/
GPX tracks record time in UTC, but most cameras and phones store local time with no time zone. If you do not tell ExifTool the offset, matches can be hours off. State it explicitly with -geotime:
exiftool -geotag track.gpx "-geotime<${DateTimeOriginal}-05:00" job-photos/
Here -05:00 is the camera's local offset from UTC. Use the offset that applied on the day you shot, including daylight saving.
If the camera clock was a few seconds or minutes wrong, use -geosync to correct it. Check the ExifTool documentation for the sign and format of the value, since getting the direction backwards doubles the error rather than fixing it. Test on one photo where you know the real location.
Photos taken outside the time range of the track will not be tagged. ExifTool allows a limited gap between track points when interpolating, so long pauses in the log can also leave photos untagged.
How do you copy GPS tags from one file to another?
Use -TagsFromFile and name the tags to copy.
exiftool -TagsFromFile source.jpg -gps:all target.jpg
This is handy when you edited a photo in software that dropped its metadata. It also works to give a set of edited exports the location of their originals:
exiftool -TagsFromFile originals/%f.jpg -gps:all exports/
%f is replaced with the base file name of each file in the destination folder, so exports/kitchen.jpg pulls GPS from originals/kitchen.jpg. Files need matching names for this to work.
How do you remove GPS tags with ExifTool?
Use -gps:all= to clear the GPS tags. Add -overwrite_original if you do not want the backup copy.
exiftool -gps:all= photo.jpg
exiftool -gps:all= -r -ext jpg folder/
Some files also store location in XMP. Run the read command afterwards with -a -G1 and look for any leftover GPS tags. If you find some, clear them with a wildcard such as -gps*=, then check again. Removing metadata before you share photos is common advice; our guide on removing location data from photos covers phone and desktop options.
How do you export GPS data from many photos to a spreadsheet?
Use -csv with the tags you want and redirect the output to a file.
exiftool -csv -n -FileName -GPSLatitude -GPSLongitude -ext jpg -r job-photos/ > gps-report.csv
Open the file in a spreadsheet. Blank cells mark photos with no GPS data, so it works as a quick audit before you publish or send a batch.
What goes wrong with ExifTool GPS tags?
Most problems come down to a handful of causes.
| Problem | Likely cause | Fix |
|---|---|---|
| Photo shows in the wrong hemisphere | Missing or wrong GPSLatitudeRef / GPSLongitudeRef |
Set both Ref tags explicitly with positive values |
| "0 image files updated" | Wrong path, wrong extension filter, or quoting problem | Check the path and -ext; use double quotes on Windows |
| Nothing changes in your photo app | App reads a different field, or caches the old data | Run exiftool -a -G1 -gps:all; reopen the app |
_original files pile up |
ExifTool's default backup behaviour | Delete them once happy, or use -overwrite_original |
| GPX geotag misses photos | Time zone offset wrong, or photos outside the track's time range | Use -geotime with an explicit offset; check the GPX dates |
| HEIC, PNG or WebP write fails | Format support varies by ExifTool version and by the app reading the file | Update ExifTool; check the version's format list; consider converting to JPG |
| Location disappears after upload | Platform stripped metadata | Check the file you uploaded, not the copy shown online |
On that last point, some platforms remove metadata when you upload, so a correct file does not guarantee the location survives. Google has not published how it uses photo metadata, so treat any claim about ranking benefits with caution. Does Geotagging Photos Help Local SEO? goes through what is known.
When is ExifTool the wrong tool?
ExifTool is excellent for scripted jobs, large archives and precise control. It is less comfortable if you tag photos occasionally, work with a team that avoids the terminal, or want to see the location before saving.
Geotagr is a browser-based alternative. You open JPG, HEIC, PNG or WebP photos, set GPS coordinates, a title, description, keywords and business details, and save. Processing happens in your browser, and photo files are not uploaded to Geotagr's servers. HEIC, PNG and WebP files are converted and saved as JPG. Batch tagging and presets are available, while GPX matching, CSV import and AI suggestions are paid features (see pricing).
A practical split: use ExifTool for automated pipelines and audits, and a visual tool for day-to-day tagging by non-technical staff.
Frequently asked questions
What is the ExifTool command to add GPS coordinates to a photo?
Use exiftool -GPSLatitude=40.7128 -GPSLatitudeRef=N -GPSLongitude=74.0060 -GPSLongitudeRef=W photo.jpg. Replace the numbers with your own decimal coordinates and set each Ref tag to match the hemisphere. Then read the tags back to confirm.
How do I see GPS tags with ExifTool?
Run exiftool -gps:all photo.jpg. Add -n to see plain decimal numbers instead of degrees, minutes and seconds, and -G1 to see which metadata group each tag belongs to.
Can ExifTool geotag photos from a GPX file?
Yes. Run exiftool -geotag track.gpx folder/. Because GPX times are in UTC and photo times are usually local, add -geotime with an explicit time zone offset, and test on a photo whose real location you know.
How do I remove GPS data with ExifTool?
Run exiftool -gps:all= photo.jpg. Then check with exiftool -a -G1 -gps:all photo.jpg for any location tags left in other groups, and clear those too if present.
Does ExifTool change my original photo?
By default it writes the change to the file and keeps a copy named with _original on the end. If you use -overwrite_original, no backup is kept, so only use it on files you have already backed up elsewhere.
Will ExifTool GPS tags survive uploading to social media or Google?
Not always. Some platforms strip or rewrite metadata on upload, and the behaviour can change. Download or inspect the file as the platform serves it to see what remains.