Removing metadata from documents: Word, PDF, and photos
A document contains more than you see. Beyond the visible content, Word files, PDFs, photos, and other files automatically store hidden information: who created it, when, on which device, and sometimes older versions of that information still present in the file structure.

Removing metadata from documents
A document contains more than you see. Beyond the visible content, Word files, PDFs, photos, and other files automatically store hidden information: who created it, when, on which device, and sometimes older versions of that information still present in the file structure.
This isn’t theoretical. In 2003, the British government published a dossier on Iraq as a Word file; a researcher read its hidden revision log and found the names of four government staff who had worked on it. In 2012, the FBI arrested a member of the Anonymous-affiliated group CabinCr3w after GPS coordinates in an iPhone photo of a woman, which he posted online, pointed to a house in Wantirna South, Australia; combined with his girlfriend’s Australian background on Facebook, that confirmed his identity.
Who this guide is for
This guide is mainly for readers who share files in contexts where hidden metadata can create real professional, legal, or personal risk.
It fits especially:
- journalists and sources handling sensitive documents
- lawyers, healthcare professionals, and other professional contexts with confidentiality obligations
- anyone sharing photos or files where location, authorship, or device data should not leak
For ordinary casual sharing, not every file needs forensic-grade treatment. This guide becomes most important when the file itself may move beyond your control after you send it.
What you gain, and what it costs
If you remove metadata properly, you usually gain:
- less accidental leakage of authorship, device, time, and location data
- a safer file-sharing baseline in sensitive contexts
- fewer hidden clues that undermine anonymity or confidentiality
But it costs something:
- some extra time before sharing
- occasional tooling friction, especially across document formats
- the need to verify results instead of assuming one cleanup step did everything
That is usually a reasonable trade when files may be redistributed or scrutinized. It becomes overkill only when you treat every normal everyday file as a covert document instead of matching the effort to the real risk.
Already cleaned files before? Two leftovers are worth checking. ExifTool keeps a backup of every file it changes (photo.jpg_original) with all the old metadata in it. And a PDF that ExifTool edited still contains the old metadata until you run the qpdf step below. Files you already sent can’t be recalled; this guide only helps from here on.
What is metadata?
Metadata is information about a file, not the content of the file itself.
In Word and Office files (from Microsoft’s list of what Document Inspector looks for):
- Author, title and the name of whoever last saved the file
- Comments, tracked changes that haven’t been accepted or rejected, versions and ink annotations
- Headers, footers and watermarks
- Hidden text and invisible objects
- Template name, email headers, routing slips and custom XML data
- In old
.docfiles: a hidden log of the last ten saves, with user names and file paths (the 2003 Iraq dossier case)
In PDF files:
- Creator (which software generated the PDF)
- Author and title, often copied over from the Word document
- Creation and modification date
- Older metadata, if the PDF was edited with incremental updates (ExifTool works this way, see below)
- Sometimes: embedded hidden layers, invisible text
In photos (EXIF data):
- GPS coordinates — exact location where the photo was taken
- Camera or phone make and model, sometimes the camera’s serial number
- Date and time of capture
- Camera settings (shutter speed, ISO, focal length)
- A small embedded preview image, which can still show what you cropped out
How to check what’s in a file
Before removing, it’s useful to know what’s actually there. Check locally: don’t upload a sensitive file to a website to read its metadata.
ExifTool (reads almost every file type, including Office files):
exiftool -a -G1 -ee filename.pdf
exiftool -a -G1 -ee photo.jpg
exiftool -a -G1 -ee document.docx
-a also shows duplicate tags, which plain exiftool hides; -G1 names where each value sits; -ee also reads embedded files, such as JPEGs inside a PDF. Install it from exiftool.org, or on Linux with sudo apt install libimage-exiftool-perl (Debian, Ubuntu) or sudo dnf install perl-Image-ExifTool (Fedora). On Linux, Metadata Cleaner (below) also shows per file the metadata it finds.
On a phone: open a photo in Apple Photos or Google Photos and swipe up to see its date, device and location. That shows only those fields, and Google Photos can also show a location it estimated itself.
Run the same check again after cleaning. It shows what the tool can read, which doesn’t prove the file is clean:
- PDF: after
exiftool -all=alone the old values no longer show, yet they are still in the file. Only the file written byqpdfor Metadata Cleaner counts. - Office: ExifTool reads only the document properties, not comments, tracked changes or hidden text. Run Document Inspector again on the cleaned copy.
- Any file: ExifTool’s documentation says it isn’t guaranteed to remove everything, and MAT2’s says no tool can reliably detect everything.
Removing metadata
Word and Office (.docx, .xlsx, .pptx)
Method 1 — Document Inspector (Word for Windows):
Microsoft advises running Document Inspector on a copy, because removed data can’t always be restored.
- Save a copy first: File → Save As, with a new name. Work in the copy.
- In the copy, go to File → Info → Check for Issues → Inspect Document.
- Tick the categories you want checked. In Word these are: Comments, Revisions, Versions, and Annotations; Document Properties and Personal Information; Headers, Footers, and Watermarks; Hidden Text; Custom XML Data; Invisible Content.
- Click Inspect.
- Click Remove All next to each category you want cleaned, then close the dialog and save.
Document Inspector misses some things: text hidden in other ways (white text on a white background) and objects covered by other objects. In Excel it finds but can’t remove external links and embedded files. Microsoft’s list also doesn’t mention metadata inside pictures you placed in a document, so clean a photo before you insert it.
On a Mac: according to Microsoft, Word for Mac doesn’t have a document inspector. You can only view and edit properties by hand via File → Properties (Summary and Custom tabs). LibreOffice (free) can do more: LibreOffice → Preferences → LibreOffice → Security → Options… → tick Remove personal information on saving, leave the “Keep …” boxes under it unticked, then open a copy of the document and save it again. According to LibreOffice’s help, that removes user data from the file properties and turns author names in comments and tracked changes into “Author1”, “Author2”; the comments and changes themselves stay.
Method 2 — Metadata Cleaner (Linux): ExifTool can read Office files but can’t write them, so exiftool -all= does not work on .docx. Metadata Cleaner does; the steps are below under PDF files.
Method 3 — Save as PDF (Word for Windows): When sharing a final version, run Document Inspector first, then:
- File → Save a Copy (or Save As for an unsaved file), then Browse.
- Choose PDF in the file type list.
- Click More Options → Options.
- Under Publish what, make sure Document is selected, not Document showing markup (that would put tracked changes in the PDF).
- Untick Document properties, click OK, then save.
This leaves out the document properties, such as author and title; the PDF can still name the program that made it. Check the result with ExifTool.
Don’t rely on Windows’ own remover. File Explorer also offers to remove properties and personal information from a file. According to Privacy Guides, that built-in remover leaves many kinds of data in place: in documents, comments, author names, tracked changes, hidden worksheets, slide notes and revision history; in photos, camera serial numbers and embedded thumbnails, which can show what you cropped out. Document Inspector (above) is a different tool, built into Office, and does cover comments, revisions and hidden content. For photos, see below.
PDF files
Metadata Cleaner (Linux): an app built on MAT2, the Metadata Anonymisation Toolkit. It handles PDF, Office and OpenDocument files, images, audio, video and more. Install it from Flathub (io.gitlab.metadatacleaner.metadatacleaner): that is the maintained fork, version 4.0.1 of 1 November 2026; the original app is archived.
- Make a copy and work on that: Metadata Cleaner cleans the file itself, and its own warning says this is irreversible.
- Click Open Files… or drag the copy into the window. The side panel shows the metadata it found.
- Click Clean and confirm with Clean.
By default each PDF page is rebuilt as an image: thorough, but text in the result can no longer be selected or searched. Lightweight Cleaning in its settings keeps the text but, in MAT2’s own words, removes only some metadata. MAT2 warns that an empty metadata list doesn’t prove a file is clean, so look with ExifTool too.
Windows and Mac: ExifTool plus qpdf (command line):
exiftool -all= document.pdf
qpdf --linearize document.pdf document-clean.pdf
Run both. ExifTool alone isn’t enough on a PDF, because its changes are reversible by design: ExifTool’s own documentation says it adds an incremental update and that old information is never actually deleted from the file; anyone can bring it back with exiftool -PDF-update:all= document.pdf. The same documentation gives the fix: rewrite the file with qpdf, the second line.
Share document-clean.pdf and delete document.pdf and document.pdf_original: both still hold the old metadata. qpdf for Windows and Mac is on its releases page (the Mac build isn’t notarised; qpdf’s README explains how to open it); on Linux: sudo apt install qpdf or sudo dnf install qpdf.
These two commands only deal with the file’s own metadata. As we read their documentation, they leave what is in the pages: pictures with their own metadata, hidden layers, text under a black box, attachments. For that, use Metadata Cleaner’s default mode, which rebuilds the PDF from page images.
Photos
On a computer: on Linux, use Metadata Cleaner (above); for iPhone photos in HEIC format turn on Lightweight Cleaning, as MAT2 cleans those only in that mode. On a Mac, Metapho (below) also runs, according to its App Store listing. On Windows, File Explorer’s own remover leaves data behind (above), so use ExifTool from the command line:
ExifTool — remove everything:
exiftool -all= photo.jpg
ExifTool — remove location only:
exiftool -location:all= photo.jpg
The often-quoted -gps:all= clears only the EXIF GPS block, so coordinates also stored in XMP stay. -location:all= clears ExifTool’s whole Location category. Both leave the date, the device and the embedded preview, and MakerNotes can’t be cleared one tag at a time: if being located could hurt you, use -all=.
ExifTool — multiple photos at once:
exiftool -all= -ext jpg -ext jpeg .
This handles the current folder, not subfolders, in upper and lower case. On Linux, *.jpg silently skips IMG_0001.JPG.
ExifTool keeps the original as photo.jpg_original, with all metadata still in it. Delete those backups before you share the folder, or work on a copy and add -overwrite_original so no backup is made.
How much -all= removes depends on the format. On a JPEG, ExifTool’s documentation says all metadata blocks and anything after the image go (Adobe’s APP14 block stays). Other formats are less complete: on PNG only XMP, EXIF, the colour profile and text chunks; on MOV and MP4 “most top-level metadata”. Check those afterwards.
On phone (iPhone): Settings → Privacy & Security → Location Services → Camera → Never. This stops the Camera from adding a location to new photos.
For existing photos (steps from Apple’s guides, iOS 27):
- Remove the location from the photo in your library: open the Photos app → open the photo → tap the info button (or swipe up) → tap Adjust Info → Adjust Location → No Location. Photos keeps the original so you can bring it back with Revert; check a shared copy if it matters.
- Leave it out for one share: in iOS 26 and earlier, tap the Share button → Options → turn off Location; “Location Not Included” then appears above Options. Apple’s iOS 27 guide no longer lists Location under Options and notes that a shared photo includes its location. If you don’t see “Location Not Included”, remove the location first (above) or use an app. Both only deal with the location: Apple notes that a shared photo also carries its date and time, device and captions.
Or use an app such as Metapho (free to download; according to its App Store listing it needs a subscription or one-time purchase, with a free trial on the yearly plan). According to that listing, its share-sheet extension can send a copy without metadata.
On phone (Android): Google Photos can’t remove a location your camera added. According to Google’s help, you can only edit or remove locations that you added yourself or that Google Photos estimated. And a photo you download or send outside Google Photos keeps its original location, whatever you changed in the app. The Android and Google documentation we read describes no option in Android’s share menu that removes a location, so assume it stays in the file.
- New photos: stop the camera app from getting your location. On stock Android: Settings → Security & privacy → Privacy → Permission manager → Location → your camera app → Don’t allow (on phones with a separate Privacy menu: Settings → Privacy → Permission manager). Some camera apps also have their own location setting.
- Existing photos: share them through Scrambled Exif, an open-source app on F-Droid that removes metadata and then reopens the share menu. Its code handles JPEG and PNG only, so not HEIC or video, and its author warns not to rely on it heavily: double-check before you share. Or clean a copy on a computer (above).
- Sharing inside Google Photos: shared albums have a Share photo locations switch per album. With partner sharing, every photo you share includes its location, according to Google.
What removing metadata doesn’t solve
- What can be seen: faces, reflections, street signs and screens stay in the picture. Google itself warns that people can guess a location from landmarks.
- File names and dates on your disk: a name like
IMG_20261106.jpgordraft-jan.docxsurvives. MAT2 says it doesn’t handle file-system metadata, so rename the file. - The content: MAT2 also says it doesn’t anonymise content or handle watermarks or writing style. A document shared with few people can point to one of them by its wording alone.
- Uploads: don’t count on a service to strip anything. An email attachment goes as it is, and a site that hides metadata from others can still receive it: Meta’s privacy policy lists the location where a photo was taken as metadata. Clean the file before it leaves your device. We did not check per app what each one strips.
Printer steganography — a different kind of metadata
Many colour laser printers print tiny yellow dots on every page, too small to see without magnification. The EFF decoded this pattern on Xerox DocuColor printers: it holds the printer’s serial number and the date and time of printing. The EFF’s tests found dots on colour lasers from Brother, Canon, HP, Xerox and others, and it warns that probably every recent colour laser printer adds some tracking code, not necessarily yellow dots and not necessarily visible.
You can’t switch this off in software. Relevant if you print documents that must not be traceable to your printer (and therefore your location or organisation):
- Share the document digitally, with its metadata removed, instead of on paper
- If it must be printed, use a public printer (library, print shop)
- A black-and-white printer can’t print yellow dots, the best-documented kind of tracking code; that doesn’t prove a page carries no other marks
- A scan or photo of a printed page can still carry the dots, because they are on the paper
When is this relevant?
Always:
- Photos you share via social media or email (GPS data)
- Documents you send to journalists, lawyers, or other sensitive recipients
Required for:
- Journalists protecting sources — every document that gets forwarded
- Lawyers sharing privileged information
- Whistleblowers submitting documents anonymously — use SecureDrop
Useful in:
- Business contexts where author name must not appear externally
- Research situations where your identity must not be in the file
Tools summary
| Tool | Formats | Platform | Use |
|---|---|---|---|
| ExifTool | Reads almost everything; removes all from JPEG, less from other images and video; PDF reversible without qpdf; can’t write Office files |
Linux, Mac, Windows | Command line, most powerful for photos |
| Metadata Cleaner | PDF, Office, OpenDocument, images, audio, video, and more (MAT2 underneath) | Linux (Flathub) | App; cleans the file itself, so work on a copy |
| Document Inspector | .docx, .xlsx, .pptx | Windows (Word for Mac has none) | Built into Office, no install |
| LibreOffice | Office and OpenDocument files: author names, dates, user data | Windows, Mac, Linux | Setting, applies when you save |
| Metapho | Photos | iPhone, iPad, Mac | App Store, subscription or one-time purchase |
| Scrambled Exif | Photos | Android | F-Droid, open source |
Next step
Go further
- SecureDrop guide — submit documents or source material anonymously
Profiles
- Profile: journalist or activist — why source protection starts with metadata
- Profile: lawyer or politician — metadata risks for professional privilege