Every file you create carries hidden metadata — timestamps, GPS coordinates, device identifiers, author names, and software versions. A photo taken on your phone may embed your exact GPS location. A Word document might contain your name, workplace, revision history, and tracked changes. Before sharing files publicly or with unknown parties, stripping this metadata is a fundamental privacy practice.
What Metadata Can Reveal
| File Type | Metadata Examples |
|---|---|
| JPEG/PNG photos | GPS coordinates, camera model, lens, date/time, software |
| Word/PDF documents | Author name, organization, revision history, hidden text |
| Audio files | Recording software, artist, album, date |
| Video files | Camera model, GPS, recording date, software |
| Screenshots | Screen resolution, OS version, software used |
ExifTool: Universal Metadata Reader and Editor
ExifTool by Phil Harvey is the most comprehensive metadata tool available — it reads, writes, and removes metadata from hundreds of file formats.
Installation
Windows:
Download the Windows executable from exiftool.org. Rename exiftool(-k).exe to exiftool.exe and place it in C:\Windows for global access.
Linux:
sudo apt install exiftool
macOS:
brew install exiftool
Reading Metadata
# View all metadata in a file
exiftool photo.jpg
# View specific tags
exiftool -GPS:GPSLatitude -GPS:GPSLongitude photo.jpg
# View metadata in a document
exiftool document.docx
Removing Metadata
# Remove ALL metadata from a single file
exiftool -all= photo.jpg
# Remove all metadata, keep original as backup (.jpg_original)
exiftool -all= -overwrite_original photo.jpg # No backup
# Remove metadata from all JPGs in a folder
exiftool -all= -overwrite_original *.jpg
# Remove metadata recursively from all files in a directory
exiftool -all= -overwrite_original -r /path/to/folder/
# Remove only GPS data (keep other metadata)
exiftool -GPS:all= photo.jpg
# Remove author and company from Office documents
exiftool -Author= -Company= -Creator= document.docx
Batch Processing with Output Directory
Preserve originals while creating clean copies:
exiftool -all= -r /original/photos/ -o /clean/photos/ --ext jpg --ext png
MAT2: Metadata Anonymization Toolkit
MAT2 is purpose-built for metadata removal with a focus on privacy. It’s the tool used by Tails OS and Whonix for metadata cleaning and supports more file types than ExifTool in some categories (especially LibreOffice formats).
Installation
Linux:
sudo apt install mat2
Flatpak:
flatpak install flathub org.onionshare.OnionShare # Bundled in some privacy tools
Basic Usage
# Check metadata in a file
mat2 photo.jpg
# Clean a single file (creates cleaned copy: photo.cleaned.jpg)
mat2 --inplace photo.jpg # Overwrites original
# Clean without overwriting
mat2 photo.jpg # Creates photo.cleaned.jpg
# Check what will be removed without removing it
mat2 --check photo.jpg
# Clean all files in a directory
mat2 --inplace *.jpg *.pdf *.docx
Supported File Types
MAT2 handles: JPEG, PNG, GIF, TIFF, BMP, PDF, MP3, FLAC, OGG, MP4, DOCX, XLSX, PPTX, ODT, ODS, ODP, ZIP, and more.
Nautilus Integration (GNOME)
On Linux with GNOME, install the MAT2 extension for right-click metadata removal in the file manager:
pip3 install nautilus-python --break-system-packages
cp /usr/share/nautilus-python/extensions/mat2_nautilus.py ~/.local/share/nautilus/extensions/
Restart Nautilus: nautilus -q && nautilus
Now right-click any file → Remove metadata.
Windows: ExifTool Context Menu
Add ExifTool to Windows right-click menu for easy access:
Create a file ExifTool_remove_metadata.reg:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Remove Metadata]
@="Remove Metadata (ExifTool)"
[HKEY_CLASSES_ROOT\*\shell\Remove Metadata\command]
@=""C:\Windows\exiftool.exe" -all= -overwrite_original "%1""
Double-click to import. Now right-click any file → Remove Metadata.
PDF-Specific Cleaning
PDFs are notoriously metadata-rich. Beyond ExifTool, use qpdf for thorough PDF sanitization:
# Install
sudo apt install qpdf
# Linearize and strip metadata
qpdf --linearize input.pdf output.pdf
# Combined with ExifTool
exiftool -all= output.pdf
Verifying Removal
After cleaning, verify metadata is gone:
exiftool cleaned_photo.jpg
# Should show minimal output — file type, size, dimensions only
# Check for GPS specifically
exiftool -GPS:all cleaned_photo.jpg
# Should return nothing
Practical Privacy Workflow
Before posting photos online or sharing documents:
- Copy files to a working directory
- Run
exiftool -all= -overwrite_original *.jpg *.png *.pdf - Verify with
exiftool filename.jpg - Share the cleaned files
For sensitive documents, also use LibreOffice’s built-in metadata cleaner: File → Properties → Reset Properties, then re-save.
Metadata removal takes seconds and eliminates a significant privacy leakage vector that most people never consider.