Batch-remove password protection from PDF files on macOS. Includes a Finder service (right-click menu) and a command-line tool for automation.
Passwords are stored in the macOS Keychain — encrypted by the system, never written to disk or committed to git.
- Unlock all PDFs in a folder in one run
- Recursive or current-folder-only mode
- Try multiple passwords from Keychain (useful when files use different passwords)
- Finder Quick Action: right-click a folder → Unlock PDFs
- Safe defaults: writes
*-unlocked.pdfcopies; optional in-place replace with backup
git clone https://github.com/mortolian/pdf-password-remover.git
cd pdf-password-remover
chmod +x install.sh
./install.shThe installer will:
- Install
qpdfvia Homebrew (if needed) - Install
pdf-unlock,pdf-password, andpdf-unlock-finderto~/.local/bin - Copy the Unlock PDFs Quick Action to
~/Library/Services
If ~/.local/bin is not on your PATH, add to ~/.zshrc:
export PATH="$HOME/.local/bin:$PATH"Enable the Quick Action: System Settings → Privacy & Security → Extensions → Finder (if prompted).
pdf-password add # name: default
pdf-password add work # optional second password
pdf-password list # shows names only, never the passwordsmacOS may prompt once to allow Terminal (or the Quick Action) to access the Keychain.
Command line — current folder only:
pdf-unlock ~/Documents/invoicesInclude all subfolders:
pdf-unlock -r ~/Documents/invoicesReplace originals (creates .bak backup first):
pdf-unlock --in-place ~/Documents/invoicesDry run (see what would happen):
pdf-unlock -n -r ~/Documents/invoicesAfter ./install.sh, one Finder service is installed: Unlock PDF
| Right-click on | Menu item |
|---|---|
| A PDF file or folder | Unlock PDF |
Look under Services (hold ⌥ Option while right-clicking if needed).
System Settings → Keyboard → Keyboard Shortcuts → Services → Files and Folders
Turn on Unlock PDF, then restart Finder:
killall FinderRun these in Terminal:
pdf-password trust
./install.shThen check the log after trying again in Finder:
tail -20 ~/Library/Logs/pdf-password-remover.log| Location | Used? | Why |
|---|---|---|
| macOS Keychain | Yes | Encrypted, OS-managed, supports multiple labels; best practice on Mac |
.env / config files |
No | Risk of accidental git commit |
| Command-line arguments | No | Visible in shell history and process list |
| This git repo | No | Never store secrets in version control |
Keychain service name: pdf-password-remover. Account name is the label you choose (default, work, etc.).
| Mode | Result |
|---|---|
| Default | report.pdf → report-unlocked.pdf |
--in-place |
Replaces report.pdf; backup at report.pdf.bak |
--output DIR |
Writes unlocked files under DIR |
Non-encrypted PDFs are skipped. Files already named *-unlocked.pdf are ignored.
Use pdf-unlock in shell scripts, cron, or launchd jobs:
#!/bin/zsh
export PATH="$HOME/.local/bin:$PATH"
pdf-unlock -r -q /Users/you/Inbox/PDFs-q prints only errors and the summary.
./uninstall.shRemoves CLI tools and the Quick Action. Keychain entries remain until you remove them:
pdf-password remove defaultpdf-password-remover/
├── assets/
│ └── banner.png # README banner image
├── bin/
│ ├── pdf-unlock # Main batch unlock CLI
│ ├── pdf-password # Keychain password management
│ └── pdf-unlock-finder # Finder Quick Action helper
├── quick-action/
│ └── Unlock PDFs.workflow # macOS Quick Action bundle
├── install.sh
├── uninstall.sh
├── README.md
├── SECURITY.md
└── LICENSE
See SECURITY.md. Use only on PDFs you own or are authorized to decrypt.
