To find where a photo was taken, read the GPS tags in its EXIF data: GPSLatitude and GPSLongitude, plus GPSLatitudeRef and GPSLongitudeRef, which say north or south and east or west. Convert the values to decimal degrees, paste them into Google Maps or OpenStreetMap, and you have the spot, usually within a few meters for a phone photo taken outdoors. If the file has no GPS tags, the metadata cannot tell you where it was shot. At best it carries a typed place name in IPTC.
How to find where a photo was taken: check for GPS first
The quickest check is our EXIF reader: upload a JPEG, TIFF, PNG or WebP file and it lists the GPS tags it finds: coordinates, altitude, direction and accuracy. On a phone, the map in the iPhone Photos Info panel or the Google Photos About panel answers the same question; see the iPhone and Android guides. With ExifTool:
exiftool -a -G1 -s -GPS:all IMG_0412.jpg[GPS] GPSVersionID : 2.3.0.0
[GPS] GPSLatitudeRef : North
[GPS] GPSLatitude : 37 deg 48' 25.10"
[GPS] GPSLongitudeRef : West
[GPS] GPSLongitude : 122 deg 28' 37.80"
[GPS] GPSAltitudeRef : Above Sea Level
[GPS] GPSAltitude : 67.3 m
[GPS] GPSSpeedRef : km/h
[GPS] GPSSpeed : 0
[GPS] GPSImgDirectionRef : True North
[GPS] GPSImgDirection : 351.2
[GPS] GPSHPositioningError : 4.7 mKeep the -a. Without it, ExifTool hides the raw GPSLatitude and GPSLongitude lines behind the Composite tags of the same name, and the GPS group looks like it has no coordinates.
One trap: uploading from a phone browser can remove GPS before the file leaves the phone. Android hides location from apps that lack the media-location permission, browsers included, and the iOS photo picker leaves location out unless you include it under Options. When it matters, copy the original to a computer and check it there.
How the coordinates are stored
GPS data sits in its own IFD, referenced from IFD0 by the GPSInfo pointer (0x8825). The four tags that matter:
| Tag | ID | Type | Test file value |
|---|---|---|---|
| GPSLatitudeRef | 0x0001 | ASCII | N |
| GPSLatitude | 0x0002 | 3 rationals | 37/1 48/1 251/10 |
| GPSLongitudeRef | 0x0003 | ASCII | W |
| GPSLongitude | 0x0004 | 3 rationals | 122/1 28/1 189/5 |
Each coordinate is three unsigned rationals: degrees, minutes, seconds. There is no minus sign anywhere in the value; the hemisphere lives only in the Ref tag. exiftool -v3 shows the raw fractions:
| | 1) GPSLatitudeRef = N
| | 2) GPSLatitude = 37 48 25.1 (37/1 48/1 251/10)
| | 3) GPSLongitudeRef = W
| | 4) GPSLongitude = 122 28 37.8 (122/1 28/1 189/5)Devices split the value differently. Some write whole degrees and minutes with fractional seconds, as above; others put all the precision in the minutes and write 0 seconds. The conversion below works for both. The GPS coordinates glossary entry covers the remaining edge cases.
Converting degrees, minutes and seconds to decimal
The formula is degrees + minutes / 60 + seconds / 3600, then a minus sign if the Ref is S or W. For the test file:
Latitude: 37 + 48/60 + 25.10/3600 = 37 + 0.800000 + 0.006972 = 37.806972 (N, positive)
Longitude: 122 + 28/60 + 37.80/3600 = 122 + 0.466667 + 0.010500 = 122.477167 (W, negative)
Result: 37.806972, -122.477167Forget the W and the point jumps to the sea off China's Shandong peninsula. That is the classic mistake in hand-rolled EXIF parsers, and it is why a tool that prints bare numbers without the Ref is not good enough.
Six decimal places is about 11 centimeters of latitude, already finer than any phone fix. Five decimals (about 1.1 m) is plenty.
Let ExifTool do the math
exiftool -n -GPSLatitude -GPSLongitude IMG_0412.jpgGPS Latitude : 37.8069722222222
GPS Longitude : -122.477166666667With -n and no group prefix, those names resolve to ExifTool's Composite tags, which already apply the Ref sign. Ask for -GPS:GPSLongitude explicitly and you get 122.477166666667, unsigned. For a readable fixed-precision version, use -c:
exiftool -c "%.6f" -GPSPosition IMG_0412.jpgGPS Position : 37.806972 N, 122.477167 WAnd for a string you can paste straight into a map search box:
exiftool -n -p '$GPSLatitude,$GPSLongitude' IMG_0412.jpg37.8069722222222,-122.477166666667In the Windows command prompt, swap the single quotes for double quotes.
Opening the spot in Google Maps or OpenStreetMap
Paste 37.806972, -122.477167 into the Google Maps search box. It also accepts the DMS form, 37°48'25.1"N 122°28'37.8"W. If you are building links, both services take coordinates in the URL:
https://www.google.com/maps/search/?api=1&query=37.806972,-122.477167
https://www.openstreetmap.org/?mlat=37.806972&mlon=-122.477167#map=18/37.806972/-122.477167The test coordinates land near the San Francisco end of the Golden Gate Bridge. Use satellite view to check a location; a pin on a plain street map hides whether the shot was taken from a balcony or the middle of the road.
Which way the camera was pointing
GPSImgDirection (0x0011) records the compass heading of the lens, from 0 to just under 360 degrees, and GPSImgDirectionRef says whether that is relative to true north (T) or magnetic north (M). The test file has 351.2 with T, so nearly due north. Phones fill it from the magnetometer, which metal railings, car interiors and magnetic cases can easily throw off. Trust it to the nearest compass point, not to the degree. More in the GPSImgDirection entry.
How accurate the position is
GPSHPositioningError (0x001F), added in EXIF 2.3 (2010), stores the estimated horizontal error in meters. The test file says 4.7 m, a typical outdoor figure. Phones do not rely on satellites alone: Apple's own documentation says the Camera's location comes from cellular, Wi-Fi, GPS and Bluetooth data. Indoors or between tall buildings, the fix may come from Wi-Fi and be off by a whole building; a large error value is the hint. More in the positioning error entry.
Altitude is less reliable than the horizontal position, and GPSDateStamp with GPSTimeStamp records the UTC time of the fix, which is not always the moment the shutter fired. Our reader shows the GPS position, altitude and accuracy tags but not the GPS time stamps; ExifTool shows all of them.
Place names in IPTC and XMP
Some photos carry a written location instead of, or next to, coordinates. Photographers and agencies fill these fields by hand, and some software fills them by reverse-geocoding the GPS.
| Field | IPTC IIM | XMP |
|---|---|---|
| City | 2:90 City | photoshop:City |
| Sub-location | 2:92 Sub-location | Iptc4xmpCore:Location |
| State or province | 2:95 Province-State | photoshop:State |
| Country | 2:101 Country-PrimaryLocationName | photoshop:Country |
| Country code | 2:100 | Iptc4xmpCore:CountryCode |
exiftool -G1 -s -IPTC:City -IPTC:Sub-location -IPTC:Province-State -IPTC:Country-PrimaryLocationName IMG_0412.jpg[IPTC] City : San Francisco
[IPTC] Sub-location : Golden Gate Welcome Center
[IPTC] Province-State : CA
[IPTC] Country-PrimaryLocationName : United StatesThese fields describe a place, not a measurement, and they can describe what the photo shows rather than where the camera stood. The newer IPTC Extension schema separates the two with LocationCreated and LocationShown. The old IIM fields are also short: City and Sub-location allow 32 bytes, and ExifTool truncates longer values with an "exceeds length limit" warning. Our EXIF reader does not display these place-name fields; ExifTool does.
Why most photos from social networks have no GPS
Facebook, Instagram, X and most large platforms re-encode uploads and drop the EXIF block, GPS included, so a photo saved from a feed almost never has coordinates. Messaging apps that compress images usually strip it too, while sending the same image as a file or document often keeps it. Email attachments, AirDrop and file-sharing links to the original (Dropbox, Google Drive) usually keep everything. The social media guide lists what each platform keeps.
Screenshots never have GPS. Once the coordinates are gone, only visual clues remain, and those are not metadata.
Using location data responsibly
Coordinates in a stranger's photo often point to a home or a school. Checking your own files before you post them and verifying where a news image was taken are the normal uses of everything above. Using someone's photos to work out where they live is a different act, and in many places it falls under stalking or harassment law. If you are on the sharing side, removing the location takes a minute.