Where EXIF data stores a photo's location, and how to read it
Short answer: EXIF data keeps a photo's location in its own GPS block, a sub-directory of the EXIF metadata. Latitude and longitude are each stored as three fractions (degrees, minutes, seconds) plus a letter saying which hemisphere: N/S and E/W. The same block can also hold altitude, the UTC time of the fix, which way the camera was pointing and how accurate the fix was.
That is more than a pin on a map, and most guides stop at "your photo has GPS in it". Below is what each field actually says, how to turn it into coordinates you can check, and what removing it does and doesn't achieve.
The GPS block, field by field
In a JPEG, the main EXIF directory holds a pointer tag called GPSInfo (0x8825). It points at a separate directory, the GPS IFD, which holds the location tags. These are the ones that matter for privacy, with their tag numbers from the EXIF standard:
| Tag | ID | What it holds |
|---|---|---|
GPSLatitudeRef | 0x0001 | N or S |
GPSLatitude | 0x0002 | Three fractions: degrees, minutes, seconds |
GPSLongitudeRef | 0x0003 | E or W |
GPSLongitude | 0x0004 | Three fractions: degrees, minutes, seconds |
GPSAltitudeRef / GPSAltitude | 0x0005 / 0x0006 | Above or below sea level, and the height in metres |
GPSTimeStamp / GPSDateStamp | 0x0007 / 0x001d | When the fix was taken, in UTC |
GPSSpeed, GPSTrack | 0x000d, 0x000f | How fast and in which direction the device was moving |
GPSImgDirection | 0x0011 | Which way the camera was facing, in degrees from true or magnetic north |
GPSProcessingMethod | 0x001b | How the position was found: the spec lists GPS, CELLID, WLAN or MANUAL |
GPSHPositioningError | 0x001f | The estimated horizontal error of the fix, in metres |
GPSDestLatitude and friends | 0x0013–0x001a | A second location: the subject, not the camera |
Not every device writes every tag, and the set varies by make, model and settings. Check your own files rather than assuming.
Two of these deserve a second look. GPSImgDirection tells someone which way you were facing, which turns "somewhere on this street" into "this side of this street, looking at that building". And comparing GPSTimeStamp (UTC) with the camera's local DateTimeOriginal gives away your time zone offset, even if you've edited the visible date.
How the coordinates are encoded
Each coordinate is stored as three unsigned fractions, numerator over denominator, with the sign kept separately in the Ref letter. A position of 40° 26′ 46.30″ N, 79° 58′ 56.10″ W is written roughly like this:
GPSLatitudeRef N
GPSLatitude 40/1 26/1 4630/100
GPSLongitudeRef W
GPSLongitude 79/1 58/1 5610/100
Some devices skip the seconds and put fractional minutes in the second value instead, for example 40/1 2677/100 0/1. Both forms mean the same thing.
To get the decimal degrees a map app understands:
decimal = degrees + minutes / 60 + seconds / 3600
Then make it negative for S or W. For the example: 40 + 26/60 + 46.30/3600 = 40.446194, and 79 + 58/60 + 56.10/3600 = 79.982250, so −79.982250. Paste 40.446194, -79.982250 into any map search and you get the spot.
The sign is where homemade scripts go wrong. The fractions are unsigned, so a reader that ignores GPSLongitudeRef puts every photo taken west of Greenwich in the wrong hemisphere. If a viewer puts your photo in the middle of an ocean or on the wrong continent, that's usually the cause.
How precise is it?
The number of digits isn't the same as accuracy, but it sets a ceiling on how exact the position can be. For latitude, roughly:
| Stored precision | About |
|---|---|
| 1 degree | 111 km |
| 1 minute | 1.85 km |
| 1 second | 31 m |
| 0.01 second, or 5 decimal places in decimal degrees | 0.3 m to 1.1 m |
A degree of longitude is the same width at the equator and narrows towards the poles. Stored precision is often far finer than the fix itself is accurate to.
Real accuracy depends on the fix. Outdoors with a clear sky, a satellite fix can be within a few metres. Indoors, or with only Wi-Fi or cell positioning, it can be off by tens or hundreds of metres. When a device writes GPSHPositioningError, that is its own estimate of the error radius. When it writes GPSProcessingMethod, you can tell a satellite fix from a network guess.
So the honest reading of a GPS block is "the device believed it was here, give or take". That is usually more than enough to find a home address.
How to read it yourself
With ExifTool, which shows every GPS tag along with the group it came from:
exiftool -a -G1 -gps:all photo.jpg
For one line of signed decimal coordinates ready to paste into a map, use the composite GPSPosition tag with -n (numbers rather than formatted text):
exiftool -n -GPSPosition photo.jpg
To catch location stored outside the EXIF GPS block as well, list every tag whose name starts with GPS, in any group:
exiftool -a -G1 "-gps*" photo.jpg
That third command matters. Editors and photo managers can write a second copy of the coordinates into XMP (as XMP-exif:GPSLatitude and so on, in a text form like 40,26.7717N). A tool that only clears the EXIF GPS block leaves that copy behind.
In the browser, the image metadata viewer reads JPEG, PNG and WebP files without uploading them and flags GPS present when it finds coordinates. It doesn't open HEIC, so convert iPhone photos first.
On a phone, the built-in info panels show a map pin but not the raw tags. The steps are in how to check photo metadata on iPhone and how to view photo metadata on Android. How to view EXIF data on any device covers Windows and Mac.
Location that isn't in the GPS block
Removing the GPS tags removes coordinates. It doesn't necessarily remove everything that names a place:
- XMP GPS copies, as above.
- Place names. IPTC and XMP have text fields for city, region, country and sublocation. Photo managers fill them in from the coordinates, and they survive a GPS-only strip.
- Your photo library's record. Phone galleries and cloud libraries keep their own copy of where each photo was taken, separate from the file. Why your iPhone keeps location with GPS off goes through where iOS keeps it.
Removing it
ExifTool can delete the EXIF GPS block with exiftool -gps:all= photo.jpg. Run the "-gps*" listing above afterwards to check for XMP copies and place names.
The GPS remover takes the blunter approach: it redraws the image in a browser canvas and saves a new file from the pixels alone. A canvas holds only pixels, so every metadata segment goes (EXIF, XMP, IPTC and C2PA alike), including copies a tag-by-tag tool might miss. It runs in your browser and nothing is uploaded. It accepts JPEG, PNG and WebP, and keeps the input format. The tradeoff: a JPEG is re-encoded at quality 0.95, so the pixels are not bit-identical to the original. Keep the original if that matters, and share the cleaned copy.
For the per-device version of all this, see how to remove location from a photo.
What reading or removing EXIF location doesn't protect against
- No GPS doesn't mean no location. A missing GPS block only means this copy of the file carries no coordinates. The place may still be inferable from what's in the picture: a street sign, a shop front, the view from a window. No metadata tool changes the pixels.
- Copies already shared keep theirs. Cleaning a file today does nothing to the original you sent last month. Platforms that strip EXIF strip the copy they serve; whether the uploaded original is kept is up to them. See which platforms strip EXIF metadata.
- The account and the upload still say something. Stripping metadata isn't anonymity. The platform knows which account posted, and when, and logs the connection regardless of what's in the file.
- The coordinates can be wrong. A stale or network-based fix can place a photo hundreds of metres away. If you're reading someone else's photo, treat the GPS block as a claim, not proof. It's unsigned and anyone can edit it.
The short version
EXIF location data lives in the GPS IFD: latitude and longitude as degrees, minutes and seconds, with N/S and E/W setting the sign, alongside altitude, a UTC timestamp, often the compass direction and sometimes an accuracy estimate. exiftool -n -GPSPosition turns it into map-ready coordinates, and "-gps*" finds the copies outside the GPS block. To be sure it's all gone, rebuild the file from pixels and then check again.