How to Extract GPS Location From Photo Files

To extract GPS location from photo files you open the image in something that reads its metadata and look at the GPS group. Nothing is being calculated or looked up online. The coordinates are already sitting inside the file, written the moment the shutter fired by a phone with location services switched on. What comes back is a latitude and a longitude, plus a small set of companion tags that decide whether those two numbers mean what you think they mean.
Reading the pair is easy. Reading them correctly is where most people go wrong, and the rest of this explains why.
How to extract GPS location from photo files
- Open the photo in a metadata viewer, or in your operating system's file properties panel.
- Find the section labelled GPS, separate from the camera and exposure sections.
- Read the latitude and longitude, then immediately read their two hemisphere tags.
- Combine them into a signed pair and paste it into any map to confirm the pin.
- Check how the fix was obtained and how accurate it claims to be before trusting it.
Step one has a privacy wrinkle worth knowing. Most online metadata readers upload your photo to a server to inspect it, which means handing a stranger the exact coordinates you were trying to look up. Our EXIF viewer reads the file in your browser without sending it anywhere, which matters more here than on almost any other kind of tool.
Why the number in the file is missing its minus sign
Open a photo taken in Rio de Janeiro and the latitude will not read −22.95. It will read 22, 57 and 6.98: three separate positive numbers, alongside a tag holding the single letter S.
This trips up everyone once. The file never stores a negative coordinate. It stores degrees, minutes and seconds as positive values, and puts the hemisphere in a companion tag: GPSLatitudeRef holds N or S, and GPSLongitudeRef holds E or W.
Take the Christ the Redeemer statue, which sits at 22°57′7″S, 43°12′38″W. To rebuild the decimal figure a map expects, divide the minutes by 60 and the seconds by 3,600, add them to the degrees, then let the letter decide the sign:
- 22 + (57 ÷ 60) + (6.98 ÷ 3600) = 22.95194
- The companion tag says
S, so the answer is −22.95194 - 43 + (12 ÷ 60) + (38.02 ÷ 3600) = 43.21056, and
Wmakes it −43.21056
Drop those two hemisphere tags and the same photo claims a spot off the coast of Somalia, roughly 9,000 kilometres away, with no error message anywhere. A viewer that shows you a bare positive number and no letter has given you half the answer.
The tags that tell you whether to trust the pin
A coordinate looks equally confident whether it came from a satellite lock or from somebody typing into a box. Two tags in the GPS group settle it, and almost nobody reads them.
GPSProcessingMethod records how the location was obtained. The EXIF specification defines four values: a satellite fix, a cell tower, a Wi‑Fi network, or manual entry. A photo whose location was typed in by hand is making a claim, not a measurement: a distinction that decides whether an image is usable as evidence in an insurance or inspection file.
GPSHPositioningError records how far out the fix might be, in metres. It is the difference between "this doorway" and "somewhere in this postcode". Guides that warn vaguely about GPS drift are describing exactly the thing this tag measures.
Read together, these two turn a pin into a piece of evidence with a stated confidence, or expose it as a guess. If a client sends you site photos and the location was entered manually with no accuracy figure, you now know to ask.
Where the camera stood versus what it was pointing at
The main coordinate pair answers where the photographer was standing. It does not say what they were looking at, and for property, survey and inspection work that gap matters.
GPSImgDirection holds the compass bearing the camera faced, with a companion tag recording whether that bearing is measured against true north or magnetic north. The two differ by enough to point at the wrong building. It is the tag that separates a photo of a shopfront from a photo taken inside it.
There is also a second, largely unknown set of location tags reserved for the subject rather than the camera, so a file can record both where the photographer stood and what they were photographing. Few cameras write it, but survey and drone tools do, and a viewer that only shows the first pair will quietly hide the second.
Reading the clock alongside the coordinates
The GPS group carries its own date and time, and these are recorded in UTC. The everyday capture timestamp elsewhere in the file is in the camera's local time.
The gap between the two is the timezone the photo was taken in, which is a useful cross-check: a photo claiming a location in Brazil whose two clocks differ by nine hours is telling you something is wrong. Where a file has been edited or assembled from parts, the pair often disagrees in ways the pixels never reveal.
When the file has no location at all
An empty GPS section is common and usually innocent. Location services were off, the camera has no receiver, the shot was taken indoors with no fix, or the photo already passed through a platform that removed the metadata. A 2023 study of 2,475 uploaded image pairs found Facebook stripped every EXIF field except Artist and Copyright, so a photo saved back down from a feed will usually arrive with nothing in its GPS section.
Nothing recovers a coordinate that was never written. No tool can infer it from the pixels. What you can do is set it deliberately. If you know where the photo was taken and the file needs to say so, add the coordinates to the file and the same tags described above get written in.
Two neighbouring jobs are worth separating from this one. A full account of every field a photo carries, not only the GPS group, is in the reference of tags you can edit. And if your reason for reading the location is that you want it gone before the photo goes out, removing the geotag is a different operation with different pitfalls; reading it is not the same as clearing it.



