Check before you send
Does my photo contain my location? How to check the file

Short answer
Drop the file into the free Koldflux Remove location from a photo tool: it says whether the file carries a GPS location and gives you a cleaned copy. Its report reads XMP only after the next deploy, so for a PNG or an app-edited JPEG also run our script (Case 1). In our seven test files, with four carrying made-up GPS, the script found 4 of 4 and ffprobe only 2 of 4, so one clean reader result does not prove a clean file.
Key takeaways
- GPS can sit in more than one place. The four files with coordinates held them in the Exif block of a JPEG (two files), in the XMP block of a JPEG, and in the Exif chunk of a PNG.
- ffprobe 6.1.1 showed GPS tags for 2 of those 4 files (5 tags each). For the XMP-only JPEG and for the PNG it printed 0, although both carried coordinates.
- Re-encoding a file can drop the location, but copying the stream keeps it. In ffmpeg 6.1.1, a stream copy kept the Exif GPS of our test file; a same-size re-encode and an 800 px resize both dropped it. That is one program, not a rule for all editors.
- After the free Koldflux tool stripped our seven files, gps-check.py found GPS in 0 of 7 outputs, and the decoded pixels (md5 of the decoded frames in ffmpeg) were identical to the originals in 7 of 7.
- Apple and Google both describe a per-share switch for location (help pages, November 24, 2026). Google also says a location your camera added cannot be removed inside Google Photos.
- Nothing here says what an app strips on upload, and the files are not from a real phone. Check the copy you will send, not the original.
Where a photo keeps your position
A phone camera with Location Services on writes the position into the picture file as metadata. The standard place is the Exif block, in its own GPS section: ExifTool documents the tags as "These GPS tags are part of the EXIF standard, and are stored in a separate IFD within the EXIF information." (ExifTool GPS tag list, official, read November 24, 2026). The tags include latitude and its N or S reference, longitude and its E or W reference, altitude, the time of the fix and the direction the camera faced.
The same coordinates can also be written into an XMP block (a text packet stored inside the file), and a PNG file can carry its own Exif chunk. Those are the cases the quick checks below miss, so we built test files for each of them.
This page is about the coordinates stored in the file. A recognisable landmark in the picture can still give a place away, and Google says as much in its help page about photo locations (official, read November 24, 2026).
Which case do you have?
Pick the line that matches the file you are about to send. Each case below has its own check.
- Case 1: a photo straight from the phone camera. Look at its info panel, then read the file.
- Case 2: a copy that was edited, resized, exported or saved from a messenger. Do not assume it is clean: read it.
- Case 3: a file where an ordinary reader says "nothing" (a PNG, or a JPEG edited by an app that writes XMP). Use a reader that looks at both places.
- Case 4: you found coordinates and want them gone. Strip a copy, then read the copy.
Case 1: a photo straight from the phone camera
Both phone makers describe an info panel. Apple says to open the photo in Photos and open its info, and that only items with embedded GPS data appear in the Map collection (Apple Support, Manage location metadata in Photos, official, read November 24, 2026). Google Photos has a details panel for the same job, and its help page says that a photo with a camera-added location shows it when shared inside Google Photos (official, read November 24, 2026). Neither app was run for this page: no accounts and no phone were available.
The panel tells you what the app knows. It does not tell you what is inside the copy you are about to attach. So also read the file, with the script below: save it as gps-check.py. It uses only the Python standard library, reads the Exif GPS section and the XMP block of JPEG, PNG and WebP files, and prints one line per file.
Source: run on November 24, 2026 (python 3.12 on the test server, files made by our make-test-files.py). On the JPEG with Exif GPS it printed "GPS FOUND, Exif GPS 44.1194, 15.2314" and exited 1. The edge cases: an empty file and a missing file both exit 2 with the reason, so a read error is not reported as "no GPS". A file that is not a JPEG, PNG or WebP also exits 2. The log is commands.log.
#!/usr/bin/env python3
"""gps-check.py: report whether JPEG, PNG or WebP files carry GPS coordinates.
Usage: python3 gps-check.py photo1.jpg [photo2.png ...]
Looks in the Exif block (JPEG APP1, PNG eXIf, WebP EXIF) and in XMP (exif:GPSLatitude).
Exit code: 0 = no GPS in any file, 1 = GPS found in at least one file, 2 = a file could not be read.
Standard library only. It reads files; it never changes them.
"""
import re
import struct
import sys
TYPE_SIZE = {1: 1, 2: 1, 3: 2, 4: 4, 5: 8, 7: 1, 9: 4, 10: 8}
def read_ifd(tiff, offset, endian):
"""Return {tag: (type, count, value_offset_or_bytes)} for the IFD at offset."""
entries = {}
if offset + 2 > len(tiff):
return entries
(n,) = struct.unpack_from(endian + "H", tiff, offset)
for i in range(n):
pos = offset + 2 + i * 12
if pos + 12 > len(tiff):
break
tag, typ, count = struct.unpack_from(endian + "HHI", tiff, pos)
size = TYPE_SIZE.get(typ, 1) * count
if size <= 4:
data = tiff[pos + 8:pos + 8 + size]
else:
(off,) = struct.unpack_from(endian + "I", tiff, pos + 8)
data = tiff[off:off + size]
entries[tag] = (typ, count, data)
return entries
def rationals(data, endian, count):
out = []
for i in range(count):
if len(data) < (i + 1) * 8:
return None
num, den = struct.unpack_from(endian + "II", data, i * 8)
out.append(num / den if den else 0.0)
return out
def exif_gps(tiff):
"""Return (lat, lon) from a TIFF/Exif block, ('tags', None) if only GPS tags without coordinates, or None."""
if len(tiff) < 8 or tiff[:2] not in (b"II", b"MM"):
return None
endian = "<" if tiff[:2] == b"II" else ">"
(ifd0,) = struct.unpack_from(endian + "I", tiff, 4)
ptr = read_ifd(tiff, ifd0, endian).get(0x8825)
if not ptr:
return None
(gps_off,) = struct.unpack_from(endian + "I", ptr[2], 0)
gps = read_ifd(tiff, gps_off, endian)
if not all(k in gps for k in (1, 2, 3, 4)):
return ("tags", None) if gps else None
lat = rationals(gps[2][2], endian, 3)
lon = rationals(gps[4][2], endian, 3)
if not lat or not lon:
return ("tags", None)
la = lat[0] + lat[1] / 60 + lat[2] / 3600
lo = lon[0] + lon[1] / 60 + lon[2] / 3600
if gps[1][2][:1] == b"S":
la = -la
if gps[3][2][:1] == b"W":
lo = -lo
return (round(la, 5), round(lo, 5))
def xmp_gps(xmp):
text = xmp.decode("utf-8", "replace")
lat = re.search(r'GPSLatitude(?:>|=")\s*([^<"]+)', text)
lon = re.search(r'GPSLongitude(?:>|=")\s*([^<"]+)', text)
if lat and lon:
return (lat.group(1).strip(), lon.group(1).strip())
return None
def blocks(data):
"""Yield ('exif'|'xmp', bytes) for every metadata block found in the file."""
if data[:2] == b"\xff\xd8":
pos = 2
while pos + 4 <= len(data) and data[pos] == 0xFF:
marker = data[pos + 1]
if marker == 0xDA or marker == 0xD9:
break
(length,) = struct.unpack_from(">H", data, pos + 2)
seg = data[pos + 4:pos + 2 + length]
if marker == 0xE1 and seg.startswith(b"Exif\x00\x00"):
yield "exif", seg[6:]
elif marker == 0xE1 and seg.startswith(b"http://ns.adobe.com/xap/1.0/\x00"):
yield "xmp", seg[29:]
pos += 2 + length
elif data[:8] == b"\x89PNG\r\n\x1a\n":
pos = 8
while pos + 8 <= len(data):
(length,) = struct.unpack_from(">I", data, pos)
kind = data[pos + 4:pos + 8]
body = data[pos + 8:pos + 8 + length]
if kind == b"eXIf":
yield "exif", body
elif kind == b"iTXt" and body.startswith(b"XML:com.adobe.xmp"):
yield "xmp", body
pos += 12 + length
elif data[:4] == b"RIFF" and data[8:12] == b"WEBP":
pos = 12
while pos + 8 <= len(data):
kind = data[pos:pos + 4]
(length,) = struct.unpack_from("<I", data, pos + 4)
body = data[pos + 8:pos + 8 + length]
if kind == b"EXIF":
yield "exif", body[6:] if body.startswith(b"Exif\x00\x00") else body
elif kind == b"XMP ":
yield "xmp", body
pos += 8 + length + (length & 1)
else:
raise ValueError("not a JPEG, PNG or WebP file")
def check(path):
with open(path, "rb") as fh:
data = fh.read()
if not data:
raise ValueError("file is empty")
found = []
for kind, body in blocks(data):
if kind == "exif":
res = exif_gps(body)
if res and res[0] == "tags":
found.append("Exif has GPS tags but no coordinates")
elif res:
found.append("Exif GPS %s, %s" % res)
else:
res = xmp_gps(body)
if res:
found.append("XMP GPS %s, %s" % res)
return found
def main(paths):
if not paths:
print("usage: python3 gps-check.py photo.jpg [more files]", file=sys.stderr)
return 2
status = 0
for path in paths:
try:
found = check(path)
except (OSError, ValueError, struct.error) as err:
print("%s: cannot read (%s)" % (path, err))
status = 2
continue
if found:
print("%s: GPS FOUND, %s" % (path, "; ".join(found)))
if status == 0:
status = 1
else:
print("%s: no GPS found" % path)
return status
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))python3 gps-check.py photo.jpg
# exit 0: no GPS found, exit 1: GPS found, exit 2: file cannot be readCase 2: an edited, resized or exported copy
A copy that went through an editor may or may not keep the location. We tested one program with a control for each step. The file is our JPEG with Exif GPS.
| What we ran | GPS in the output |
|---|---|
| Stream copy (-c copy) | Kept: 44.1194, 15.2314 |
| Same-size re-encode (-q:v 3) | Gone |
| Re-encode with -map_metadata 0 | Gone |
| Resize to 800 px wide, re-encoded | Gone |
| PNG with Exif GPS, stream copy | Kept |
| PNG with Exif GPS, re-encode | Gone |
Ffmpeg 6.1.1 on the JPEG with Exif GPS, each result read with gps-check.py.
Source: measured on November 24, 2026, commands in commands.log and test-results.txt (the PNG rows are the two PNG controls there). The same-size re-encode is the control that separates "resizing" from "re-encoding": it lost the GPS without changing the size, and the stream copy did not lose it. This describes ffmpeg 6.1.1 with these options on our files. Photoshop, Lightroom, ImageMagick, phone editors and messengers are untested here and can behave differently.
ffmpeg -i photo.jpg -c copy copy.jpg
python3 gps-check.py copy.jpg
ffmpeg -i photo.jpg -q:v 3 reencoded.jpg
python3 gps-check.py reencoded.jpgCase 3: a reader that says nothing
ffprobe is the reader many people already have, so we asked it for the tags of every test file. The command that worked for a JPEG was the frame tags, not the format tags.
Source: test-results.txt and commands.log. ffprobe 6.1.1 printed 5 GPS tags for the JPEG with Exif GPS and 5 for the JPEG with a thumbnail, and 0 for the XMP-only JPEG and for the PNG, both of which hold the same coordinates (gps-check.py reads them). Nothing in the output says the file might hold more.
That is why one clean result does not prove a clean file. A reader reports the places it looks at. When it says 0 and the file came from a phone, try a second reader that looks in XMP and in PNG chunks before you decide.
ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 photo.jpg | grep -ci gps
Case 4: strip the location, then check the copy
The free Remove location from a photo tool on this site reads the file in your browser, shows what it holds and gives you a cleaned copy. On its page it says it removes Exif, XMP, IPTC, comments and trailing data and keeps the colour profile and, by default, the rotation flag. Its own page reports a separate 29 photo test, 4 of which carried GPS (the tool's own number). Rather than lean on that, seven new files went through it.
| File | What it carries | ffprobe GPS tags | Tool said | GPS left after |
|---|---|---|---|---|
| 0 clean original | no Exif, XMP or GPS (only an 18-byte comment) | 0 | No GPS location | none |
| 1 Exif GPS (JPEG) | GPS, make, model, date | 5 | Location found and removed | none |
| 2 XMP-only GPS (JPEG) | GPS in XMP only | 0 | Location found, stored in XMP (after fix) | none |
| 3 camera Exif, no GPS | make, model, date | 0 | No GPS location | none |
| 4 GPS, then re-encoded | no GPS (only an 18-byte comment) | 0 | No GPS location | none |
| 5 Exif GPS (PNG) | GPS, make, model, date | 0 | Location found and removed | none |
| 6 Exif GPS + thumbnail | GPS, 7.0 KB of Exif | 5 | Location found and removed | none |
Seven test files through the Koldflux tool, then read again with gps-check.py.
Source: measured on November 24, 2026 (tool-run-raw.txt and tool-run-fixed-raw.txt in the log folder). All seven outputs read as no GPS with gps-check.py, and the decoded pixels matched the originals in 7 of 7 files (md5 of the decoded frames in ffmpeg, test-results.txt). Control: file 0 is the clean original and file 4 shows what an earlier re-encode already removed (the GPS). The tool removed an 18-byte comment from both of these files and from files 1, 2, 3 and 6.
One detail from this run. For file 2, the build live that morning removed the XMP block (362 bytes) but told us "No GPS location in this file", because it only looked for the location in Exif. We fixed the report the same day, with a regression test, and re-ran: the tool now reads XMP and says "stored in XMP". The new numbers above are from a local build of that fix and ship with this page; the old wording was a report error, not a left-over location.

What we did not test
The honest limits of this page:
- All seven files come from one CC0 photo, rescaled by us. The GPS values (44.1194 N, 15.2314 E) are made up, written by our own script, not by a real phone.
- We did not run ExifTool or ImageMagick. Our attempt to download ExifTool for the test was blocked, so every reader here is our script or ffprobe 6.1.1.
- HEIC, video files and any phone or desktop app are outside the test, and the Apple and Google steps above were read, not run.
- We did not test what Instagram, WhatsApp, TikTok, X or any other service strips when you upload. Do not read this page as saying any of them keep or remove location.
- A clean file can still show where it was taken: a street sign, a landmark or a reflection are in the pixels.
What to do next
Match your situation:
- Sending one photo from an iPhone: use the Share Sheet, Options, Location off (Apple Support), then read the copy you received with a reader that checks XMP too.
- Sending a batch or an old export: run python3 gps-check.py *.jpg in the folder (the script reads files, not folders), one line per file, and strip only the files that say GPS FOUND.
- Posting a resized photo from your own pipeline: read the output file, not the original. Re-encoding dropped it in our ffmpeg test, but a stream copy kept it.
- Your photos go to a shop or a print service: strip the copy first. Resize them for the web with the photo resolution guide, then check them.
Do it in your browser
Free Koldflux tool, no account needed.
Questions people ask
How can I tell if a photo has GPS location data?
Read the file, not the screen. The script (python3 gps-check.py photo.jpg) prints GPS FOUND with the coordinates or no GPS found, and exits 1 or 0. In our seven test files it found the coordinates in 4 of 4 files that carried them, in Exif and in XMP, in JPEG and in PNG.
Does ffprobe show GPS data in a photo?
Sometimes. ffprobe 6.1.1 showed GPS tags for 2 of our 4 files with coordinates, both JPEGs with Exif GPS, and printed 0 for the XMP-only JPEG and for the PNG. A 0 from ffprobe is not proof that no location is stored.
Does resizing a photo remove its location?
It did not need to be the resize. In our ffmpeg 6.1.1 test the GPS survived a stream copy and was gone after a same-size re-encode and after an 800 px resize. Other programs may behave differently, so read the output file.
Is removing GPS the same as making a photo anonymous?
No. Removing the coordinates does not touch the pixels, so a landmark or a street sign still shows where you were. Google says the same in its help page on photo locations (official, read November 24, 2026).
Do Instagram or WhatsApp strip the location when I upload?
That is unconfirmed: no accounts were available for this run. Check the file you send, and treat what a platform does afterwards as open.
Related
More guides on this topic
Sources and how we checked
- Koldflux test log: gps-check output on 7 files, ffprobe tag counts, ffmpeg controls, pixel check, summary counts (our measurement, November 24, 2026) (checked 2026-11-24)
- Koldflux command log: every published command with its exit code and an edge case (checked 2026-11-24)
- Koldflux gps-check.py: the reader script used on this page (checked 2026-11-24)
- Koldflux tool runs in headless Chromium: before the fix (tool-run-raw.txt) and after it (tool-run-fixed-raw.txt) (checked 2026-11-24)
- ExifTool: GPS tags (official, read November 24, 2026) (checked 2026-11-24)
- Apple Support: Manage location metadata in Photos (official, read November 24, 2026) (checked 2026-11-24)
- Google Photos Help: Understand, find and edit your photos' locations (official, read November 24, 2026) (checked 2026-11-24)
- DEV Community: How to check and remove EXIF data from your photos (third party, read November 24, 2026 for coverage comparison, not run) (checked 2026-11-24)
- iTechGuides: How to check a photo for GPS data and remove it safely (third party, read November 24, 2026 for coverage comparison, not run) (checked 2026-11-24)
We took one CC0 photo (Lighthouse Zadar, Wikimedia Commons, public domain dedication), rescaled it, and built seven test files with our own stdlib script: a clean original, a JPEG with Exif GPS, a JPEG with GPS in XMP only, a JPEG with camera Exif and no GPS, a copy of file 1 resized and re-encoded, a PNG with an Exif chunk, and a JPEG with GPS and a 160 px Exif thumbnail. The GPS values are made up. We read every file with our gps-check.py and with ffprobe 6.1.1 (frame tags), ran each through the live Koldflux Remove location tool in headless Chromium, read the outputs again, and compared decoded pixels with md5 in ffmpeg. We ran stream copy, same-size re-encode and resize controls in ffmpeg 6.1.1, and edge inputs for the script (empty, missing, truncated, non-ASCII file name, not an image). While testing we found the tool reported no location for the XMP-only file although it had removed the XMP block, fixed that with a regression test the same day, and re-ran on a local build. ExifTool and ImageMagick were not run; we used no phone and no app account, and did not test any platform upload. We read two third party how-to pages for coverage comparison and did not run them: both explain checking from an info panel or viewer, neither shows test results, and neither mentions XMP or PNG. Apple, Google, ExifTool, Instagram, WhatsApp and the others named are trademarks of their owners; Koldflux is not affiliated with or endorsed by them.