Your files never leave your device. All processing happens locally in your browser.
How do I password-protect a PDF so it cannot be opened without the password — entirely in my browser, without uploading the file?
Open Protect PDF, drop your PDF onto the page, type a password of at least four characters and confirm it, then press Protect PDF. The tool encrypts the document in your browser with the battle-tested @pdfsmaller/pdf-encrypt-lite library, applying real 128-bit RC4 encryption per the PDF 1.7 standard (ISO 32000-1), and hands back a new file that desktop PDF software, Chrome, Firefox and every major reader will refuse to open until the correct password is entered. A live strength meter rates the password from Weak to Very Strong as you type, and a confirm field with show/hide toggles guards against typos. Nothing is uploaded: the PDF is read with the browser File API, encrypted on your own device and downloaded straight from a local Blob as your file name with a -protected.pdf suffix. Because everything runs client-side there is no account and no server, and the password is never stored or transmitted — which also means it cannot be recovered if forgotten, so choose one you will remember. It sets the document-open (user) password, so the password is genuinely required to view any content, not merely a permissions flag that some readers ignore.
Adds a real document-open password — the PDF cannot be opened or read until the correct password is typed, in Acrobat, Chrome, Firefox and every major reader
Uses 128-bit RC4 encryption per the PDF 1.7 standard (ISO 32000-1) via the battle-tested @pdfsmaller/pdf-encrypt-lite library
Live strength meter (Weak → Very Strong) plus a confirm field and show/hide toggles so you do not lock yourself out with a typo
Runs 100% in your browser — no upload, no account, no server — so the file and password never leave your device
Downloads as your file name with a -protected.pdf suffix; there is no password recovery, so keep the one you set
What is
Protect PDF
Protecting a PDF means encrypting the document so that a password is required before its contents can be viewed. When you set a document-open (also called user) password, a PDF reader derives an encryption key from that password and uses it to scramble the page content, so the file on disk is an unreadable stream of bytes until someone supplies the correct password and the reader decrypts it. This is stronger than an owner or permissions password, which only sets flags asking a reader not to print or copy and which many viewers simply ignore — a document-open password genuinely blocks access. The PDF specification supports several encryption algorithms: RC4 at 40 or 128 bits in older files (PDF 1.4–1.6), and AES at 128 or 256 bits from PDF 1.6 and PDF 2.0 onward. This tool applies 128-bit RC4 per the PDF 1.7 standard (ISO 32000-1) using the @pdfsmaller/pdf-encrypt-lite library, which is widely compatible with desktop PDF software and browser readers; the encryption is performed entirely in your browser, so the file is never uploaded.
No. The PDF is encrypted entirely in your browser, so the file and the password never leave your device — there is no upload, server or account.
Nothing is uploaded. When you choose or drop a PDF, the tool reads it locally with the browser File API, encrypts it on your own machine with the @pdfsmaller/pdf-encrypt-lite library and returns the protected file from a local Blob for download. There is no server, upload, database, login or tracking in the processing path, which matters because the PDFs people protect — contracts, bank statements, medical records, ID scans — are exactly the documents you would not want to hand to a cloud service. The file and the password you type stay in the tab; the tool works offline once the page is cached, and closing the tab discards everything. The only optional network use anywhere on the site is consent-gated advertising, which never sees your files.
It uses real 128-bit RC4 encryption per the PDF 1.7 standard (ISO 32000-1), not AES-256. That keeps casual readers out and opens everywhere, but for highly sensitive files AES-256 is the stronger choice.
This tool applies 128-bit RC4 encryption — the algorithm the PDF 1.7 standard (ISO 32000-1) defines and that desktop PDF software, Chrome and Firefox all open natively — through the battle-tested @pdfsmaller/pdf-encrypt-lite library. RC4 at 128 bits reliably blocks anyone without the password from opening the document and is the most broadly compatible option, which is why it remains common. Be aware of the trade-off, though: RC4 is an older cipher that cryptographers consider weaker than AES, and it was deprecated in the newer PDF 2.0 specification in favour of AES-256. For everyday privacy — keeping a statement or contract away from casual eyes — 128-bit RC4 with a strong password is perfectly serviceable. For data where a determined, well-resourced attacker is a real threat, prefer a tool that writes AES-256, and always pair it with a long, high-entropy password, because the password’s strength matters more than the cipher for real-world attacks.
There is no recovery. Because the encryption runs on your device with no account or server, nobody — including us — can reset or retrieve the password, so store it somewhere safe.
A document-open password is not stored anywhere: it is only ever used, in your browser, to derive the key that encrypts the file, and it is never transmitted or saved. That is the point of genuine client-side encryption — there is no server-side copy and no backdoor — but it also means a forgotten password cannot be reset or recovered by anyone. Before you protect an important document, write the password down in a password manager or another safe place, and consider keeping an unprotected original in secure storage. The tool helps you avoid a lockout at the moment of protecting: it requires you to confirm the password in a second field and shows a live strength meter with show/hide toggles so you can verify exactly what you typed. If you later have the password but want to remove the protection, the companion Unlock PDF tool strips it back off in the browser.
Yes. It is free and runs in any modern browser on a phone, tablet or computer, and the protected file opens with a password prompt in desktop PDF software, Chrome, Firefox and every major reader.
Protect PDF is completely free with no account, watermark or limit, and because it is 100% client-side it works in any modern browser on Android, iPhone, iPad, Windows, macOS or Linux without installing an app. The output is a standard encrypted PDF written to the PDF 1.7 (ISO 32000-1) specification, so it is fully interoperable: open it in desktop PDF software, Apple Preview, Chrome, Edge, Firefox or any conforming reader and you will be prompted for the password before the pages appear. One PDF is protected at a time and the practical ceiling is your device’s memory, so a very large file is bounded by available RAM; on a phone a big document may encrypt a little more slowly, but the result is the same portable, password-protected PDF.
Detailed Explanation
📖How It Works
Password-Protecting a PDF in the Browser
Protect PDF adds a password to a PDF so the document cannot be opened without it — and it does the whole job in your browser, without sending the file anywhere. You drop a PDF onto the page, type a password of at least four characters and confirm it, then press Protect PDF; the tool reads the file with the browser File API and encrypts it on your own device with the battle-tested @pdfsmaller/pdf-encrypt-lite library, applying real 128-bit RC4 encryption defined by the PDF 1.7 standard (ISO 32000-1). The result is a standard encrypted PDF that desktop PDF software, Chrome, Firefox and every major reader will open only after the correct password is entered. Crucially, it sets the document-open (user) password, which genuinely encrypts the page content — unlike an owner or permissions password, which only asks a reader not to print or copy and which many viewers ignore. A live strength meter rates the password from Weak to Very Strong, a confirm field and show/hide toggles prevent typos, and the finished file downloads from a local Blob as your file name with a -protected.pdf suffix. Because the encryption runs client-side, the password is never stored or transmitted; it also cannot be recovered if forgotten, so it should be kept safe.
Sets a document-open (user) password — the file cannot be opened until the password is entered, not just a permissions flag
Real 128-bit RC4 encryption per PDF 1.7 (ISO 32000-1) via @pdfsmaller/pdf-encrypt-lite; opens in Acrobat, Chrome and Firefox
Encrypts entirely in the browser with the File API — no upload, server or account
Live strength meter, confirm field and show/hide toggles; downloads as name-protected.pdf
📋Use Cases
When to Password-Protect a PDF
The reason to protect a PDF is almost always the same: the document holds something you do not want the wrong person to read. Common cases are emailing a contract, invoice or salary slip; sharing a bank or credit-card statement with an accountant; sending scans of identity documents, passports or certificates; distributing medical records, legal filings or exam papers; and archiving personal files on a shared or cloud drive where a document-open password adds a real barrier. Because the encryption here is genuine document-open encryption, it protects the file wherever it travels — forwarded by email, dropped in shared storage or copied to a USB stick — not just on the machine that made it. It is well suited to keeping documents away from casual and opportunistic access, which covers the large majority of everyday needs. For the narrower case of guarding highly sensitive data against a determined, well-resourced adversary, a strong password matters more than anything, and an AES-256 tool is the stronger cipher choice; for routine confidentiality, 128-bit RC4 with a good password does the job and, unlike a cloud protector, never asks you to upload the very file you are trying to keep private.
Typical uses: contracts, invoices, pay slips, bank statements, ID scans, medical or legal documents, exam papers
Genuine document-open encryption protects the file everywhere it is sent, not only on your computer
Ideal for keeping documents from casual or opportunistic access — the majority of everyday needs
For a determined attacker, use a long password and prefer AES-256; for routine privacy, 128-bit RC4 suffices
🔧Technical Details
How the Encryption Is Applied
When the page loads at /protect-pdf it renders the Protect PDF component (src/pages/tools/pdf/PdfEncrypt.tsx), a self-contained React view. You add a PDF by drag-and-drop or the file picker; the handler accepts only files whose type is application/pdf and stores the File in state. Two password fields drive the flow: a live getPasswordStrength routine scores the password on length and character variety (lowercase, uppercase, digits and symbols) and maps it to Weak, Fair, Strong or Very Strong, while a confirm field must match and the password must be at least four characters before the Protect button enables. On submit, the file is read into an ArrayBuffer and wrapped in a Uint8Array, then passed with the password to encryptPDF from the @pdfsmaller/pdf-encrypt-lite package, which performs real 128-bit RC4 encryption per the PDF 1.7 standard (ISO 32000-1) and returns the encrypted bytes. Those bytes are wrapped in a Blob of type application/pdf and offered for download as the original file name with its .pdf replaced by -protected.pdf. All of this — reading, encrypting and packaging — happens in the browser tab on your own device; there is no worker round-trip to a server and no network request, and if the library throws (for example on a corrupt file) the tool surfaces a clear inline error instead of a broken download.
Only application/pdf files are accepted; the password must be at least four characters and match its confirmation
getPasswordStrength scores length and character variety into Weak / Fair / Strong / Very Strong
encryptPDF from @pdfsmaller/pdf-encrypt-lite applies 128-bit RC4 (ISO 32000-1) to the file’s bytes
Output is a Blob downloaded as name-protected.pdf; a library error shows a clear inline message
⚠️Limitations
Honest Limitations
The encryption is real, but it is worth being precise about what it does and does not give you. First, the cipher is 128-bit RC4, chosen for maximum compatibility; RC4 is an older algorithm that cryptographers consider weaker than AES and that the newer PDF 2.0 specification deprecates in favour of AES-256. For everyday confidentiality it is fine, but for data facing a determined, well-resourced attacker AES-256 is the safer choice. Second, no PDF password is stronger than the password itself — a short or common password can be brute-forced regardless of the cipher, so length and randomness matter more than anything; the strength meter is guidance, not a guarantee. Third, this tool sets the document-open (user) password only; it does not configure owner-level permission restrictions such as no-printing or no-copying, and in any case those flags are advisory and widely ignored, so genuine encryption is the meaningful protection. Fourth, because everything is client-side there is no password recovery: a forgotten password cannot be reset by anyone, so store it safely. Finally, one PDF is processed at a time and the whole file is held in browser memory, so a very large document is bounded by your device’s RAM, and the input must be a readable, non-encrypted PDF — an already-protected or corrupt file will error rather than double-encrypt.
128-bit RC4 is broadly compatible but weaker than AES and deprecated in PDF 2.0; prefer AES-256 for high-stakes data
Security depends on the password — a weak one can be brute-forced whatever the cipher
Sets the document-open password only, not owner/permission flags (which readers can ignore anyway)
No password recovery, one file at a time, bounded by device RAM; input must be a readable, unencrypted PDF
🔒Privacy & Security
Privacy: The File and Password Stay on Your Device
The documents people password-protect are usually the sensitive ones — contracts, bank statements, medical records, identity scans — so it would be self-defeating to upload them to a cloud service just to lock them. This tool never does. The PDF is read with the browser File API, encrypted on your own device with the @pdfsmaller/pdf-encrypt-lite library and handed back from a local Blob for download, with no server, upload, database, logging, API or CDN anywhere in the processing path. The password is only ever held in memory to derive the encryption key; it is never written to storage or sent over the network, which is exactly why there is no way to recover it. There is no login and no telemetry, the tool keeps working offline once the page has been cached, and closing the tab discards the file, the password and everything else. The only optional network use anywhere on the site is consent-gated advertising, which never sees your files — a meaningful contrast with cloud protectors that require you to upload the very document you were trying to keep private.
File read, encrypted and packaged entirely in the browser; nothing uploaded
No server, upload, database, API or CDN in the processing path; no login or telemetry
The password lives only in memory to derive the key — never stored or transmitted, hence unrecoverable
Works offline once cached; closing the tab discards the file and password
Protect PDF — encryption, compatibility and limits
Capability
Support
Notes
Protection type
Document-open (user) password
Genuinely encrypts the content; the file cannot be opened without the password, unlike advisory permission flags
Encryption
128-bit RC4 (ISO 32000-1)
Applied by @pdfsmaller/pdf-encrypt-lite per the PDF 1.7 standard; broadly compatible but weaker than AES-256
Reader compatibility
Acrobat, Chrome, Firefox, Edge, Preview
A standard encrypted PDF that prompts for the password in every conforming reader
Password help
Strength meter + confirm + show/hide
Scores Weak to Very Strong on length and variety; a confirm field prevents typos and lock-outs
Recovery
None by design
The password is never stored or sent, so a forgotten password cannot be reset — keep it safe
Best for
Everyday confidentiality
Contracts, statements, ID scans; for a determined attacker prefer AES-256 with a long password
Privacy & scale
In-browser, bounded by RAM
Encrypted on-device, one PDF at a time; 100% client-side, no upload
Protect PDF adds a document-open (user) password to a PDF entirely in the browser: the file is read with the File API and encrypted on-device by the @pdfsmaller/pdf-encrypt-lite library with real 128-bit RC4 per the PDF 1.7 standard (ISO 32000-1), producing a standard encrypted PDF that desktop PDF software, Chrome, Firefox and every conforming reader open only after the correct password is entered. A live strength meter, a confirm field and show/hide toggles help you set a password you will not fumble, and the result downloads as name-protected.pdf. The protection is genuine encryption rather than advisory permission flags, but be aware of the trade-offs: 128-bit RC4 is broadly compatible yet weaker than AES-256 and deprecated in PDF 2.0, security depends on the strength of the password you choose, and because nothing is uploaded the password is never stored and cannot be recovered if forgotten. Everything runs on-device, one PDF at a time, bounded by your RAM; nothing is uploaded.