How to Match Photos to a GPX Track (and Fix Time Offsets)
October 28, 2026
To match photos to a GPX track, you compare each photo's capture time with the timestamped points in the GPX file. The software finds where you were at that moment and writes those coordinates into the photo's EXIF data. The steps are simple. The part that goes wrong is the clock: if your camera's time is off, or set to a different time zone than the track, every photo lands in the wrong place.
This guide covers the process, how to correct a clock offset, and how to fix photos that refuse to match.
What you need before you start
Three things have to line up:
- Photos with a capture time. Cameras and phones write this as
DateTimeOriginalin EXIF. Screenshots, edited exports and some PNG or WebP files may have no capture time at all. Without it, there is nothing to match. - A GPX file recorded during the same period. This can come from a handheld GPS, a watch, or a phone app such as a hiking or running tracker.
- A known relationship between the camera clock and the track clock. This is the one people skip.
If you aren't sure what your photos contain, check them first. The free photo metadata checker shows the timestamp and any existing GPS data, and our guide to EXIF data explains the fields.
How GPX matching works
A GPX file stores a track as a list of points. Each point has a latitude, a longitude and usually a time. GPX times are normally in UTC.
Camera times are different. Classic EXIF capture time is "local time as the camera thought it was", with no time zone attached. Some newer cameras and phones also record a separate offset field, but you can't count on it.
So the matching tool has to answer: what UTC time was this photo taken? That means knowing the camera's time zone and any drift in its clock. Then it does one of two things:
- Interpolates between the two track points either side of the photo time, giving a position between them.
- Snaps to the nearest point if it is close enough in time.
Most tools also have a maximum gap. If the nearest track point is, say, 20 minutes away, a good tool will skip the photo rather than guess.
Step by step: matching photos to a GPX track
1. Collect everything from one trip
Keep the photos and the GPX file for the same outing together. If you recorded several tracks in a day (a pause and restart on a watch, for example), gather all of them. Many tools accept more than one file.
2. Work out the clock offset
This is the key step. There are three common situations:
- Phone photos and a phone-recorded track. Both clocks are usually network-synced, so the offset is typically zero apart from the time zone handling. Test on a few photos.
- Camera set to local time, track in UTC. The offset is your UTC difference at that place and date, including daylight saving.
- Camera clock that has drifted or was never set properly. You need to measure it.
The most reliable way to measure it is to photograph a reference clock at the start of the trip. Take a picture of your GPS device or a phone showing the exact time. Later, compare the time on the screen with the photo's EXIF time. The difference is your offset.
If you forgot, you can estimate it afterwards. Find a photo where you know exactly where you were, such as a trailhead sign or a building entrance. Look up when the track passed that spot. The gap between that time and the photo's timestamp is your offset.
3. Apply the offset and run the match
Enter the offset in whichever tool you use, run the match, and spot-check a few photos on a map. Check one near the start, one in the middle, and one near the end. If the first looks right but the last is off, the camera clock drifted during the trip.
4. Write the coordinates to the files
Matching can be a preview only. Make sure you save the result into the photo files (or sidecar files) so the GPS data travels with them.
Tools that can do it
You have several options, and the right one depends on how much you want to script.
| Option | Good for | Notes |
|---|---|---|
| ExifTool | Large batches, scripting | Command line. The -geotag option reads a GPX file and -geosync sets a time offset. |
| digiKam | Photo library management | Desktop app with a GPS correlator for matching against tracks. |
| Lightroom Classic | Existing Lightroom users | The Map module can load a tracklog and auto-tag photos. |
| Browser-based tools | Quick jobs without installing software | Check where your files are processed before using one. |
Geotagr is a browser-based option. It supports GPX track matching and batch tagging, and everything is processed in your browser, so photo files are not uploaded to Geotagr's servers. GPX import is a paid feature; see pricing. HEIC, PNG and WebP files can be opened, but they are converted and saved as JPG.
Troubleshooting photos that won't match
Nothing matches at all. Check that the photo dates fall within the track's date range. The usual cause is a time zone error of several hours, or a track from a different day.
Everything is shifted by a fixed amount. That is a clean offset error. Photos will appear to be consistently "behind" or "ahead" of where you really were. Adjust the offset and rerun.
Photos match at the start but drift later. The camera clock gained or lost time. Use a reference photo at the start and another at the end if you can, and check how much the gap changed.
Some photos match and others are skipped. The track probably has gaps, for example where the GPS lost signal in a building or under heavy cover. Photos taken during the gap exceed the maximum time difference. You can raise the limit, but be aware the position becomes a guess.
Photos appear in a straight line between two points. Interpolation draws a straight line across a gap. If the track records a point every few minutes, photos between points will sit on that line, not on the real path.
Photos from several cameras. Each camera needs its own offset. Process them separately, since two cameras rarely have the same clock error.
Existing GPS data gets overwritten. Decide beforehand whether you want to replace coordinates a phone already recorded. Phone GPS is often more accurate for a single spot than a track interpolated across minutes.
Accuracy: what to expect
Matched coordinates are only as good as two things: the track's recording interval and the clock correction. A track logging every second gives close positions if the clock is right. One logging every minute, with you walking or driving between points, gives approximate ones.
For work where the exact spot matters, such as job-site documentation for contractors, verify a sample on a map before relying on the batch.
Also remember that sharing is a separate decision. GPS in the file means anyone who gets the original can read it, and some platforms strip metadata when you upload. If you'd rather not publish location, see how to check photo metadata before sharing.
FAQ
Do I need a GPS device to geotag photos from a camera without GPS?
You need some source of location with timestamps. A phone running a tracking app works well. Start it before you begin shooting and leave it running.
Is the GPX time in UTC?
Usually, yes. The GPX standard uses UTC for point times, though always confirm if your source app is unusual. Your camera is the part more likely to be in local time.
What if my camera has no timestamp?
Then there is nothing to match against. You would need to assign locations manually or by another method, such as a CSV with filenames and coordinates.
Can I match photos to a GPX track if I forgot to sync the clock?
Often, yes. Use a photo taken at a known place, find when the track passed that place, and use the difference as the offset. Check a few other photos afterwards.
Does matching change my photos?
It adds GPS fields to the metadata. The image itself isn't altered, though some tools re-save the file, and any HEIC, PNG or WebP converted to JPG is a new JPEG file.