Remove PDF Metadata on Linux — 3 Free Methods Compared
- Browser tool: fastest, no install — works in Firefox and Chrome on any distro
- ExifTool: best for batch removal and scripting
- Ghostscript: most thorough but recompresses the entire PDF
- All three are free and process files locally
Table of Contents
Linux gives you three solid options for removing PDF metadata: a browser-based tool that needs nothing installed, ExifTool for batch command-line removal, and Ghostscript for the most thorough sanitization at the cost of recompressing the file. This comparison covers the right choice for each use case — from a quick one-off job to automated pipeline processing.
Option 1: Browser-Based Tool — No Install Required
Open Firefox, Chrome, or any Chromium-based browser on your Linux machine and use the PDF Metadata Remover. It runs entirely in the browser using standard web APIs — no package manager, no dependencies, no root access needed.
Upload your PDF. The tool reads the file locally (no server upload), shows you every populated metadata field in a before/after comparison, then strips all eight standard fields when you click the button. Download the clean file.
Best for: One-off cleanup, users who don't want to install system packages, sandboxed or restricted environments, quick verification of what a PDF contains before deciding whether to strip it.
Limitation: Processes one file at a time. For batch removal, the command-line options below are more efficient.
Option 2: ExifTool — Best for Batch Removal and Automation
ExifTool is available in most Linux distribution repositories. Install it with your package manager:
sudo apt install exiftool # Debian/Ubuntu sudo dnf install perl-Image-ExifTool # Fedora/RHEL sudo pacman -S perl-image-exiftool # Arch
To strip all metadata from a single PDF:
exiftool -all= document.pdf
ExifTool creates a backup (document.pdf_original) by default. Add -overwrite_original to skip the backup:
exiftool -all= -overwrite_original document.pdf
For all PDFs in a directory:
exiftool -all= -overwrite_original *.pdf
Best for: Batch processing, shell scripts, cron jobs, automated pipelines. Handles hundreds of files in seconds.
Note on thoroughness: ExifTool removes both the standard DocInfo fields and XMP metadata. However, it may leave PDF-specific structural elements that Ghostscript's approach removes by rewriting the entire file.
Sell Custom Apparel — We Handle Printing & Free ShippingOption 3: Ghostscript — Most Thorough Sanitization
Ghostscript takes a different approach: rather than editing the metadata in place, it reprocesses the entire PDF from scratch. This produces the most thoroughly clean output — metadata embedded in unusual locations, JavaScript, and some embedded objects get dropped in the process.
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dNOSAFER -c "[ /Author () /Creator () /Producer () /Title () /Subject () /Keywords () /CreationDate () /ModDate () /DOCINFO pdfmark" -f input.pdf -o output.pdf
The simpler version that removes metadata by reconstructing the file:
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -o output.pdf input.pdf
Best for: Maximum sanitization, security-critical workflows, documents going into legal discovery or regulated submission portals.
Trade-offs: Ghostscript recompresses the PDF, which may slightly increase or decrease file size and can affect PDF/A compliance. Embedded fonts may be reencoded. Complex PDFs with advanced features occasionally have rendering differences after Ghostscript reprocessing.
Comparison: Which Linux Method Should You Use?
| Method | Install Required | Batch Support | Thoroughness | Speed (single file) |
|---|---|---|---|---|
| Browser tool | None | No (one at a time) | DocInfo + overlapping XMP | Under 10 seconds |
| ExifTool | Yes (package manager) | Yes (unlimited) | DocInfo + XMP | Under 1 second |
| Ghostscript | Yes (often pre-installed) | Yes (via scripting) | Full file reconstruction | 1-30 seconds depending on PDF size |
For most Linux users: use the browser tool for quick jobs, ExifTool for batch automation, and Ghostscript when you need the highest level of confidence that nothing is hiding in the file.
How to Verify the Metadata Was Removed on Linux
After stripping, confirm the metadata is gone using ExifTool's read mode (even if you used a different tool for removal):
exiftool cleaned.pdf | grep -E "Author|Creator|Producer|Create Date|Modify Date|Title|Subject|Keywords"
All matched lines should be empty or absent. You can also check with pdfinfo (available in the poppler-utils package):
pdfinfo cleaned.pdf
The Author, Creator, Producer, and date fields should show blank or "none." This confirms the document is clean before distribution.
Remove PDF Metadata in Your Browser — No Linux Package Required
Works in Firefox and Chrome on any distro. Upload, strip, download. No system dependencies.
Strip PDF Metadata FreeFrequently Asked Questions
Does Ghostscript completely remove all metadata, including XMP?
Ghostscript's reprocessing approach removes the standard DocInfo metadata and usually drops XMP as well. For guaranteed removal of all XMP metadata, run ExifTool after Ghostscript: exiftool -all= -overwrite_original output.pdf
Will ExifTool remove metadata from PDFs that are password-protected?
ExifTool can read metadata from password-protected PDFs in some cases, but cannot write to them without the owner password. Use the unlock-pdf browser tool first, then strip metadata.
Does the browser tool work on Linux without X11 or a desktop environment?
The browser tool requires a graphical web browser. For headless Linux servers, use ExifTool or Ghostscript from the command line instead.
Which method is safest for documents with sensitive content?
For maximum security, combine Ghostscript (full file reconstruction) followed by ExifTool (explicit field removal). The browser tool is appropriate for most civilian use cases. All three methods process files locally — none upload to external servers.

