Photo

How to Remove GPS and EXIF Metadata Without Recompressing JPEG Pixels (and What Still Remains)

Remove JPEG metadata segments, check the resulting orientation and color, and review what the photo, its filename and companion files still reveal.

You need to send a camera JPEG to a contractor who needs the detail in a hairline crack but has no reason to know the building's coordinates. Opening the photo in an editor and choosing “save JPEG” may remove some tags, but it can also encode the picture again. For an existing JPEG, common location tags can be removed by editing the file's metadata segments while copying its compressed image data intact. That choice affects which details survive and which checks you should perform before sharing.

Identify the tag, the container and the pixels

EXIF commonly stores latitude and longitude in a GPS directory, with separate references for north or south and east or west. An application may combine those fields into a map pin or a decimal coordinate. Removing the displayed pin in a photo library may change a library record while leaving the exported original untouched. Inspect the exact file that will leave your machine. XMP or IPTC can independently contain a city, caption, creator or address even when no numeric GPS tag appears.

JPEG areaCommon contentsLocal stripping behavior before the first scan
APP1EXIF, embedded thumbnail or XMPRemove the segment
APP13Photoshop resources, often IPTCRemove the segment
COMFree-form commentRemove the segment
Other application segmentsICC profile or vendor dataRetain the segment
Start of scan and following bytesCompressed picture and possible later dataCopy the remainder intact

JPEG segments have boundaries. The file starts with a start-of-image marker, and many segments begin with a marker followed by a length. A segment-aware operation uses that length to skip the complete metadata block. Searching for the word “GPS” and deleting neighboring bytes is unreliable: the directory can identify fields numerically, and deleting a few bytes can invalidate offsets elsewhere in the same EXIF structure. When the entire APP1 segment is removed, everything carried inside it goes together.

Illustrative segment before the first scan
FF FE 00 06 54 45 53 54     COM marker, length 6, text TEST
Remove the whole segment    8 bytes shorter
Keep the scan payload       identical compressed bytes
Hash of the whole file      changes because a segment disappeared

The length value in this example includes its own two bytes, but excludes the two marker bytes. That explains why removing a segment with length six reduces the total file by eight bytes. Real EXIF blocks can be much larger. An identical hash for the entire file would mean the output bytes were unchanged. A different hash is expected after successful removal, but by itself says nothing about whether the compressed picture was preserved or which tags were removed.

Inspect, strip and reopen the actual download

Before-and-after byte strips show APP1 and APP13 removed while JPEG scan data stays intact.
The JPEG stripper skips selected marker segments while preserving the compressed scan. Files can contain other segments, including ICC color profiles.

Start with the local image metadata viewer and inspect the original. Note which location, camera, timestamp and orientation fields are detected. If you export a JSON report for comparison, store it privately. It may contain exactly the coordinates you intend to remove. Open the original in the on-device stripping tool, run removal and download a separate JPEG. Reopen the downloaded copy in the viewer and repeat the same checks. Opening the original a second time by accident is surprisingly easy with similar names.

Compare the photo in the application where it will be used. A phone might store landscape-oriented pixel rows and use an EXIF orientation tag to instruct a viewer to rotate them for portrait display. Removing the instruction can make the copy appear sideways even though every compressed scan byte was preserved. If the delivered picture must have a particular orientation, plan that step explicitly. Re-exporting it in a general photo editor commonly triggers another lossy JPEG encoding pass.

Inspect color as well. An ICC profile in APP2 can stay with the picture while descriptive tags in APP1 disappear. That can help a color-managed viewer present the file as intended. It also demonstrates why a smaller file is not the same as a file with every non-image byte removed. Two viewers can apply different color management or orientation rules to the same encoded picture. Use the same viewer and zoom when comparing fine detail around the crack in the contractor example.

Choose between whole-block removal and a selective edit

If the recipient must retain a photographer's credit or a capture time, removing the entire metadata block may be too broad. The photo and video metadata editor can inspect or edit supported individual fields and temporarily uploads the file for processing. Review that disclosure before choosing a sensitive original. After a selective edit, inspect the result again for duplicate descriptions in other metadata families. Deleting an EXIF location does not automatically remove a street address that someone typed into an IPTC caption.

When the source is a Motion Photo, copying bytes from the first scan onwards can preserve the appended movie as well. Removing the metadata that describes the motion layout may make extraction harder without removing the movie from the file. Decide which asset you intend to share before stripping. If it is a still only, extract the still from the original first and inspect that standalone output. Review a companion movie separately because it may carry location or record speech and surroundings.

For an audit trail, record the input and output sizes, the count of segments removed, and which test fields disappeared. Keep that record without reproducing the coordinate values in a public ticket. Two APP1 segments removed means two container blocks, not two individual tags. A single EXIF block can hold dozens of fields along with a small preview, so the count has no direct relationship to the number of sensitive details.

Check the package you intend to send

A JPEG exported to a clean folder is easier to audit than a shared album. Inspect the saved JPEG itself, then inspect the list of files being attached. A companion XMP file, a location in the album name, or an address visible on the envelope in the photo can undo the privacy benefit of removing the GPS tag.

Limitations of metadata removal

The local operation removes supported metadata in JPEG and PNG. Other application-specific bytes, later JPEG segments, trailing payloads or identifying patterns in the picture can survive. An empty report from a limited viewer establishes only that its supported fields were not detected. It cannot guarantee anonymity. Read the filename, look at signs, badges and reflections, and inspect any archive you plan to send for sidecars, thumbnails or the unedited original. A street sign in the picture can disclose the location more precisely than a rounded GPS coordinate.

If sharing requires blurring a face or covering a serial number, the picture itself must change. Keep a master and review the edited copy at full size. Saving a conventional photographic JPEG from newly rendered pixels uses lossy compression, even at a high quality setting. Removing metadata from an already encoded JPEG avoids that additional pass. Retain the verified final attachment separately from the private original and comparison report so that the file you tested is the one the recipient receives.

References & further reading

Tools for this guide