DEV Community

Marco Ryszka
Marco Ryszka

Posted on

Your JPEG photos may contain GPS coordinates: inspect and remove metadata locally

A photo is more than the pixels you can see.

JPEG files often contain EXIF and related metadata: the camera model, capture time, editing software, orientation, author fields, and sometimes precise GPS coordinates. That information can be useful while organizing a private library. It can also reveal more than intended when the file is shared publicly.

Disclosure: I used an AI assistant to help draft and edit this article, then reviewed and verified the technical claims and links before publication.

This is not a reason to panic or delete every metadata field. It is a reason to inspect the file and make a deliberate choice before publishing it.

What can be stored in a JPEG?

Common metadata includes:

  • camera and lens model;
  • date and time of capture;
  • GPS latitude, longitude, and altitude;
  • image orientation;
  • author, copyright, and description fields;
  • thumbnails created by the camera;
  • editing software and modification timestamps;
  • ICC color profiles and other rendering information.

The exact fields depend on the camera, phone, scanner, and editing workflow. Social platforms may remove some metadata, but uploading a file first means trusting that platform to handle it as expected. If the file is sensitive, remove unwanted data before the upload.

Start with a simple threat model

The right action depends on where the image is going.

For a private archive, capture dates, camera data, and GPS coordinates may be valuable. For a public product photo, a copyright field might be useful while a home address encoded as GPS is not. For an anonymous report or a photo of a private location, the safest default is usually to remove everything that is not required to display the image correctly.

Ask three questions:

  1. Who will receive the original file?
  2. Which metadata fields help that recipient?
  3. What would happen if every remaining field became public?

Option 1: inspect the metadata from the command line

ExifTool is the most capable general-purpose option. To inspect a file:

exiftool photo.jpg
Enter fullscreen mode Exit fullscreen mode

To remove metadata while keeping a backup of the original:

exiftool -all= photo.jpg
Enter fullscreen mode Exit fullscreen mode

ExifTool normally creates photo.jpg_original. After checking the cleaned file, you can decide whether to retain that backup.

To avoid the backup file:

exiftool -all= -overwrite_original photo.jpg
Enter fullscreen mode Exit fullscreen mode

Be careful with broad removal in automated pipelines. Orientation and color-profile information can affect how an image is displayed. Always verify the resulting pixels, dimensions, and colors in the applications your audience uses.

Option 2: use operating-system controls

Some desktop systems expose a subset of metadata in file properties or an export dialog. These controls are convenient but vary by operating-system version and usually do not make it obvious which EXIF, XMP, IPTC, thumbnail, or color-profile segments remain.

For low-risk sharing, that may be enough. For sensitive files, verify the output with a second metadata reader instead of assuming that a “remove properties” button removed every relevant segment.

Option 3: process the JPEG locally in the browser

I built Refentra’s JPEG metadata remover for the case where installing a command-line tool is unnecessary but uploading the original image to a converter is undesirable.

The file is parsed and cleaned locally in the browser. The image bytes are not sent to Refentra, no account is required, and the result can be downloaded immediately. There is also a separate metadata editor when the goal is to inspect or change selected text fields rather than strip the file.

Disclosure: I maintain Refentra. It is a free web utility, not an open-source package, so ExifTool remains the better choice when you need auditable source code, scripting, batch automation, or support for many file formats.

Verify the result instead of trusting the button

Whatever method you use, verification is the important step.

  1. Keep the original in a private location until the cleaned copy is verified.
  2. Open the cleaned file and check orientation, dimensions, and colors.
  3. Inspect it with a second tool such as ExifTool.
  4. Confirm that sensitive fields such as GPS coordinates, author names, comments, and embedded thumbnails are absent.
  5. Share the cleaned copy, not the original.

For an ExifTool check:

exiftool cleaned-photo.jpg
Enter fullscreen mode Exit fullscreen mode

A short output is not automatically proof that every possible container segment is gone, but comparing the before-and-after reports makes accidental retention much easier to spot.

Metadata removal is one layer, not anonymity

Removing metadata does not hide information visible in the pixels. Street signs, reflections, faces, documents, landmarks, screen contents, and unique surroundings can still identify a person or location. File names, cloud-sharing URLs, account profiles, and posting times can also reveal context.

Treat metadata cleaning as one step in a broader review:

  • inspect the pixels;
  • crop or blur sensitive details;
  • use a neutral file name;
  • remove unnecessary metadata;
  • verify the exported copy;
  • consider whether the posting account itself reveals identity.

The useful habit is simple: inspect first, remove deliberately, and verify before sharing.

Which metadata fields do you intentionally preserve in your own photo workflow, and which ones do you remove by default?

Top comments (0)