ExifTool Remove All Metadata: The Command, and What Survives It

One command strips EXIF, GPS, IPTC and XMP from a photo. What -all= actually deletes, the flags people forget, what survives by design, and how to verify the…

Every photo you publish carries a second file inside it: camera model, serial number, the exact time it was taken and — if location services were on — GPS coordinates accurate to a few metres. exiftool -all= removes all of that in one line. Three things about that line are easy to get wrong: it leaves a backup copy behind, it does nothing at all if you forget the =, and it takes the colour profile with it.

This page is the command, what survives it, and how to prove the file is clean afterwards.

The command that does the job

# One file, no backup copy left behind
exiftool -all= -overwrite_original photo.jpg

# What is actually left in the file now
exiftool -a -G1 -s photo.jpg

-all= is a tag assignment with nothing on the right-hand side: set every tag to empty. The = is the whole operation. Run exiftool -all photo.jpg without it and ExifTool prints every tag in the file instead of deleting anything — exit code 0, no warning, and you walk away believing the photo is clean.

The second flag matters just as much. Without -overwrite_original, ExifTool renames the original to photo.jpg_original and writes the cleaned version under the real name. If you then upload the file your image browser happens to show first, you may have published the exact copy you were trying to clean.

What -all= deletes, and what it does not

MetadataRemoved by -all=?Notes
EXIF (camera, lens, serial, timestamp)YesIncludes the embedded thumbnail, which often still shows the original framing
GPS latitude, longitude, altitudeYesThe tag most people run this command for
IPTC and XMPYesXMP includes the editing history in some editors
ICC colour profileYes — and usually should not beCovered below; wide-gamut photos shift colour without it
OrientationYes — and usually should not bePortrait phone photos display sideways once it is gone
Adobe APP14 segment (JPEG)No, by designRemoving it can change how the image renders, so ExifTool keeps it
Extended attributes (macOS "Where from", quarantine)NoThey live beside the file, not in it; use xattr -c
Container dates in MP4/MOVPartlyThe video atom survives; remux with ffmpeg (below)
PDF Info dictionaryPartlyA PDF has metadata in two places; see the table further down

Keep the colour profile and the rotation

Two tags are worth rescuing from the wipe, because losing them breaks the image rather than protecting you.

# Copy those two tags back from the file itself, in the same pass
exiftool -all= -tagsfromfile @ -icc_profile -Orientation -overwrite_original photo.jpg

# Equivalent exclusion form
exiftool -all= --icc_profile:all -overwrite_original photo.jpg

@ means the file being processed, so ExifTool reads the values before it clears them and writes them back. Keep the ICC profile if the photo started in Display P3, Adobe RGB or ProPhoto RGB: browsers assume sRGB for an untagged image, so a wide-gamut photo comes out flat or muddy. Keep Orientation if the picture was shot in portrait on a phone — the pixels are stored unrotated and the flag is what turns them, so stripping it makes every portrait shot display sideways.

A whole folder, without surprises

There is no true dry-run flag. The closest thing is -o, which writes the cleaned copies somewhere else and leaves the originals untouched, so you can look at the output before replacing anything.

# 1. Write cleaned copies to a new folder and inspect them
exiftool -all= -o cleaned/ -r ~/Pictures/blog

# 2. In place, recursive, keep the file modification date
exiftool -all= -overwrite_original -P -r ~/Pictures/blog

# 3. Restrict it to web image formats only
exiftool -all= -overwrite_original -P -r -ext jpg -ext jpeg -ext png -ext webp ~/Pictures/blog

-P preserves the filesystem modification time. Without it every file gets today's date, which reorders photo libraries and churns cloud backups for no reason.

To find which files are actually leaking a location, filter instead of dumping thousands of tag listings:

exiftool -r -if '$GPSLatitude' -p '$Directory/$FileName' ~/Pictures

PDFs, Office documents and video need a second tool

File typeWhat to runWhy exiftool alone is not enough
PDFexiftool -all= doc.pdf then qpdf --linearize doc.pdf clean.pdfA PDF carries an Info dictionary plus an XMP stream, and unreferenced objects survive a tag wipe; a linearising rewrite drops what nothing points at
DOCX, XLSX, PPTXmat2 document.docxThese are ZIP containers; author and revision data sit in docProps as well as in the XML body
MP4, MOVffmpeg -i in.mp4 -map_metadata -1 -c copy out.mp4Container atoms such as creation time are regenerated by the remux rather than edited
HEICexiftool -all=, same as JPEGWorks, but prints an ICC warning in some builds; check the result
macOS extended attributesxattr -c file.jpg"Where from" and quarantine flags are filesystem metadata, invisible to ExifTool

Treat this as risk reduction, not sanitisation. If you are publishing a document someone else produced, a clean tag listing is evidence, not proof — the only safe claim is that the fields you checked are gone.

Verify like you mean it

# All tags, grouped, in short form; -a shows duplicated tags too
exiftool -a -G1 -s photo.jpg

# Count what is left, before and after
exiftool -a -G1 -s -json photo.jpg | jq '.[0] | keys | length'

On a typical phone photo the before count is 60 to 120 tags; after -all= it should be a handful of structural tags such as ExifToolVersion, FileName, FileSize and ImageWidth. If you still see GPSLatitude, the command never applied — check for the missing =, or for a backup file sitting next to the original.

Windows and Linux

# Install
winget install OliverBetz.ExifTool      # Windows
choco install exiftool                  # Windows, Chocolatey
sudo apt install libimage-exiftool-perl # Debian/Ubuntu (package name differs from the command)
brew install exiftool                   # macOS

In PowerShell, quote anything containing a colon or an equals sign that the shell might eat: exiftool "-all=" photo.jpg and exiftool "--icc_profile:all" photo.jpg. Windows also keeps its own metadata in the file properties sheet, and NTFS alternate data streams are not ExifTool's business.

If you already overwrote something

If an _original copy exists, exiftool -restore_original photo.jpg puts it back. If the run used -overwrite_original, there is nothing to restore — re-export from the camera roll, the RAW file or the cloud copy. That is the reason to test on -o cleaned/ first when the batch is large.

Do not use an "online metadata remover"

Uploading a photo to a website to remove its GPS tag means sending that photo, GPS tag included, to a machine you do not control. Most such services promise deletion after some hours; none of them can give you back the moment the file was written to their disk, and the upload itself is logged. ExifTool is a 12 MB install that runs offline.

Frequently asked

Does -all= reduce image quality?

No. It rewrites the metadata segments and keeps the compressed image data byte for byte, so the pixels are identical. The file size drops because the tag blocks are gone — often 5 to 20 KB on a phone photo.

Will it remove the watermark or the crop?

No. A watermark is drawn into the pixels and a crop changes the pixels. Metadata removal only affects text fields.

Why do I still see Make and Model after running it?

Either the = was missing, the command ran on a different copy than the one you inspected, or a backup file is being served instead of the cleaned file. Print the resolved path with exiftool -FileName -Directory photo.jpg.

Does it strip metadata from a screenshot?

Screenshots often have almost none to begin with — no camera and no GPS — but they do carry software and timestamp tags. Running the command is harmless and makes the result predictable.

Yes. It edits files you own. The line is at authorship and evidence: removing metadata from a document to disguise where it came from, or from an image you did not create, is a different act with different consequences.

Where this fits in a workflow

Run it on the export folder, not on the camera roll — you want the originals intact for re-export. In an assessment, photos of a client site carry GPS coordinates and capture timestamps that are evidence for you and a disclosure risk for them; strip on the copy that goes into the report, never on the copy you keep. If you are building a picture of a target from public images, the same tags are a source: OSINT work starts with what a photo already tells you, which is why the photo you post is a decision, not a detail.


Keep reading

Related articles

Browse all articles