To remove metadata with ExifTool, run exiftool -all= image.jpg. It deletes EXIF, GPS, XMP, IPTC and other metadata without touching the compressed image data, and saves the original as image.jpg_original. To keep colors and rotation intact, use exiftool -all= -tagsfromfile @ -colorspacetags -orientation image.jpg; to remove only the location, use exiftool -gps:all= -xmp:geotag= image.jpg.
ExifTool quick reference
These are the commands most people need. Each is explained further down. Replace image.jpg with your file and DIR with a folder.
| Task | Command |
|---|---|
| Show all metadata with groups | exiftool -a -G1 -s image.jpg |
| Show only location | exiftool -a -G1 -gps:all -xmp:gps* image.jpg |
| Remove all metadata | exiftool -all= image.jpg |
| Remove all, keep color profile and rotation | exiftool -all= -tagsfromfile @ -colorspacetags -orientation image.jpg |
| Remove only GPS | exiftool -gps:all= -xmp:geotag= image.jpg |
| Remove camera serial numbers | exiftool -SerialNumber= -LensSerialNumber= -makernotes:all= image.jpg |
| Remove the embedded thumbnail | exiftool -ThumbnailImage= image.jpg |
| Clean a folder and subfolders | exiftool -r -all= -ext jpg -ext png -ext webp DIR |
| Write cleaned copies elsewhere | exiftool -all= -o cleaned/ DIR |
| No backup files | add -overwrite_original |
| Undo using the backups | exiftool -restore_original DIR |
| Find files that still have GPS | exiftool -r -if '$GPSLatitude' -T -directory -filename DIR |
On Windows, the Command Prompt does not treat single quotes as quotes. Use double quotes around arguments that contain $, for example -if "$GPSLatitude". PowerShell and macOS or Linux shells accept the single-quoted versions shown here.
Install ExifTool
- Windows: download the Windows executable zip from exiftool.org, extract it, rename
exiftool(-k).exetoexiftool.exe, and keep it in the same folder as theexiftool_filesdirectory. Put that folder in your PATH so you can runexiftoolfrom any terminal. - macOS: install the
.pkgfrom exiftool.org, or runbrew install exiftoolif you use Homebrew. - Linux:
sudo apt install libimage-exiftool-perlon Debian and Ubuntu,perl-Image-ExifToolon Fedora. Our Linux guide compares ExifTool with mat2, ImageMagick and jhead.
Check the installation with exiftool -ver, which prints the version number.
How to view metadata with ExifTool
Plain exiftool image.jpg prints friendly descriptions, but it hides duplicates and does not tell you where each value is stored. For privacy work, use this instead:
exiftool -a -G1 -s image.jpg
-ashows duplicate tags, which matters because the same date or location can exist in both EXIF and XMP.-G1prefixes each line with its specific group, such as[GPS],[ExifIFD],[XMP-exif],[IPTC]or a maker note group named after the brand, like[Apple]or[Canon].-sprints real tag names (DateTimeOriginal) instead of descriptions ("Date/Time Original"), which you need to write commands.
To see a few fields only, name them: exiftool -Make -Model -SerialNumber -GPSPosition image.jpg. For a spreadsheet-friendly report of a whole folder, exiftool -csv -r DIR > report.csv writes one row per file.
One field deserves a special look. Many JPEGs carry a small preview in ThumbnailImage, and some editors do not update it after cropping. Extract it to see what it shows:
exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg
Remove all metadata with exiftool -all=
The -TAG= syntax means "set this tag to nothing", which deletes it. -all= applies that to every writable tag in every group. Here is what happens when you run it:
- ExifTool removes EXIF (including GPS and maker notes), XMP, IPTC, Photoshop data, JPEG comments, the ICC profile and other blocks it can write.
- The compressed image data is copied unchanged, so there is no quality loss and no re-encoding.
- The original file is renamed to
image.jpg_originaland the cleaned file takes the original name.
One documented exception: the JPEG APP14 "Adobe" segment is not removed by -all=, because it can affect how the image is decoded. It holds color-transform information, not personal data.
Keep the ICC profile and orientation
Deleting everything has two side effects. Photos shot in a wide color space such as Display P3 can look washed out without their ICC profile, and photos whose pixels are stored sideways can appear rotated once the Orientation tag is gone. The fix is to delete all, then copy those items back from the same file, which ExifTool calls @:
exiftool -all= -tagsfromfile @ -colorspacetags -orientation image.jpg
ColorSpaceTags is an ExifTool shortcut for ICC_Profile, ColorSpace, Gamma and InteropIndex, described on the ExifTool shortcuts page as useful "for preserving color space when deleting all other metadata". None of these items identify you. Our explainers on ICC color profiles and EXIF orientation go into the details.
You can also exclude a whole group from deletion with a double dash. The ExifTool documentation gives -all= --exif:all as the way to delete everything except EXIF. That pattern is handy, but be careful which group you spare: EXIF contains GPS, and IPTC can contain city and country fields.
Remove only selected metadata
Sometimes you want to keep useful information, such as a caption or copyright notice, and remove only what is risky.
Remove GPS location only
exiftool -gps:all= -xmp:geotag= image.jpg
-gps:all= deletes the EXIF GPS block: GPSLatitude, GPSLongitude, GPSAltitude, GPSImgDirection and the GPS timestamp. Photo editors and geotagging software may also write coordinates into XMP, which -xmp:geotag= removes, as shown in ExifTool's geotagging documentation. Text location fields (IPTC or XMP City, Sub-location, Country) are separate tags; check for them in the -G1 listing. Our guide on removing GPS location from photos shows how to do this without a terminal too.
Remove serial numbers and maker notes
The EXIF standard has a BodySerialNumber field, which ExifTool names SerialNumber, and a LensSerialNumber. Many manufacturers also store serial numbers and other device details inside maker notes, a proprietary block that varies by brand:
exiftool -SerialNumber= -LensSerialNumber= -makernotes:all= image.jpg
Why this matters is explained in our article on camera serial numbers in photos.
Remove XMP, IPTC or the thumbnail
exiftool -xmp:all= image.jpg
exiftool -iptc:all= image.jpg
exiftool -ThumbnailImage= image.jpg
Wipe everything but keep your copyright
Photographers often want to strip location and camera data while keeping credit. Delete all, then copy back the fields you want:
exiftool -all= -tagsfromfile @ -colorspacetags -orientation \
-Artist -Copyright -XMP-dc:Creator -XMP-dc:Rights \
-IPTC:By-line -IPTC:CopyrightNotice image.jpg
Tags that do not exist in the source are simply skipped. To add a notice to images that have none, write it directly: exiftool -Copyright="Your Name" -XMP-dc:Rights="Your Name" image.jpg.
Clean whole folders without losing anything
ExifTool processes folders natively, so you do not need a shell loop. A few options make bulk runs safe:
-rrecurses into subfolders. Folders whose names start with a dot are skipped.-ext jpg -ext png -ext webplimits processing to those extensions. Case is not significant, so.JPGfiles are included. Without-ext, ExifTool also processes PDFs, RAW files and anything else it can write.-o cleaned/writes cleaned copies into another folder and leaves the originals alone. The trailing slash marks it as a directory, which ExifTool creates if needed. Existing files are not overwritten.-overwrite_originalskips the_originalbackups. Use it only on copies or when you have a separate backup.-restore_originalputs the backups back, and-delete_originaldeletes them once you are satisfied.-Pkeeps the file's modification date, which helps if you sort files by date.-progressshows a running count on large folders.
A complete, safe command for a folder of photos you are about to publish:
exiftool -r -all= -tagsfromfile @ -colorspacetags -orientation \
-ext jpg -ext jpeg -ext png -ext webp -o cleaned/ DIR
Note that -o with a plain folder name puts all output files in one flat folder. If two subfolders contain files with the same name, the second one is not written, and ExifTool reports it.
How to check that ExifTool removed everything
Run the same inspection command on the cleaned file. After a full -all=, you should only see groups that describe the file rather than its history: [ExifTool], [System] (file name, size, dates on your disk), [File] (dimensions, encoding) and [Composite] (values ExifTool calculates). If you kept color and orientation, a few ICC_Profile lines and an Orientation tag remain.
To audit a folder for location data, the -if option prints only the files that still match:
exiftool -r -if '$GPSLatitude' -T -directory -filename -gpsposition DIR
-T prints one tab-separated line per file. Empty output means no file in the folder has a GPS latitude left. For other ways to confirm a clean file, see how to check that metadata was really removed.
Common ExifTool mistakes
- Running
-all=without-exton a mixed folder. ExifTool will happily strip RAW files and PDFs too. RAW files in particular rely on maker notes for correct processing. - Using
-overwrite_originalon your only copies. Metadata such as capture dates is useful in your own archive. Clean copies for sharing instead. - Forgetting sidecar files. Lightroom, darktable and other editors may keep metadata in a separate
.xmpfile next to the image. If you share the folder, the sidecar goes with it. - Removing only EXIF.
-exif:all=leaves XMP and IPTC, which can repeat the date, location and creator. Use-all=unless you have a reason not to. - Assuming a clean file is an anonymous file. ExifTool removes data stored with the image, not what the image shows: faces, street signs and screen contents stay visible.
When a command line is more than you need
ExifTool is the most precise option, but it is a lot of syntax for cleaning three vacation photos on a phone. For that, our free metadata remover works in any browser: it takes up to 10 JPEG, PNG or WebP images at once, keeps the pixels untouched in its default mode, preserves only the color profile and orientation flag (the same result as the -colorspacetags -orientation command above), and shows you a report of what it removed. Files are processed on our server and deleted automatically 10 minutes later. For large archives, selective edits or offline work, ExifTool remains the right tool.