OnsitePDF
Sign in

How to password-protect a PDF

Encrypt a PDF with a password so only the right person can open it — done on your device with AES-256, never uploaded.

To password-protect a PDF, open the Protect PDF tool, drop in your file, type a password and confirm it, then click Process and Download to save the encrypted copy. Anyone who opens it is asked for the password first. The encryption is AES-256 and it happens on your device, so neither the file nor the password is uploaded.

Password protection is the simplest way to keep a sensitive document, such as a payslip, a tax return or a signed agreement, private when you send it to someone else. Uploading that same document to an online "PDF password" service defeats the purpose: you hand the unprotected file to a third party in the very act of trying to protect it. Encrypting locally means the plain version never leaves your machine.

Step by step

  1. Open the Protect PDF tool.
  2. Drop in the PDF you want to lock. The tool takes one file at a time.
  3. Type a strong password, then confirm it by typing it again.
  4. Decide which permissions to allow. The toggles are Allow printing, Allow copying text and Allow editing, and all three start switched on.
  5. Click Process and download the encrypted PDF.

The first time you use the tool, your browser downloads the WebAssembly encryption engine from this site, so the first run may take a little longer. After that the engine runs entirely on your device. The About page shows how to watch the Network tab while you encrypt a file and confirm that no request carries your document or your password.

What the permission toggles do

The password you set is the one needed to open the file. The three toggles control what someone can do once they have opened it. Switch off Allow printing to stop the document being printed, Allow copying text to stop its text being copied out, and Allow editing to stop it being modified, which also covers annotating and filling in forms. With all three left on, the password alone is the protection.

Be realistic about what these restrictions are. They are flags that PDF viewers are expected to respect, and well-behaved software does. A password to open the file is far stronger than a restriction on what a reader can do, because the contents stay encrypted until the password is supplied. If the aim is keeping a document secret, rely on the open password and treat the toggles as a courtesy.

Choosing a good password

Other ways to password-protect a PDF

Adobe Acrobat. A paid Acrobat plan includes password protection with several security options. It is a solid choice if you already have it installed and use it regularly.

macOS Preview. On a Mac, Preview can add a password through its export options. Choose to encrypt when you export the PDF and enter the password. It is quick and works offline, and it makes a good option for a one-off job on a Mac.

Word and other editors. Word can encrypt a document with a password, but that protects the Word file itself. When you then export to PDF you may need to apply the PDF protection as a separate step, so check the exported file before sending it.

Zipping or encrypting the attachment. Putting the PDF in a password-protected archive works, but the recipient needs software that can open it, which is often less convenient than a PDF that asks for a password in any viewer.

Online upload services. They are easy to find, but they receive your file and your password. For a document sensitive enough to protect, that is usually a trade not worth making.

Common problems

I forgot the password. There is no recovery. The password exists only on your device while the file is encrypted, and nothing is stored or sent anywhere, so a forgotten password means the contents cannot be read. Keep the unprotected original.

The tool will not accept my password. Check that both entries match, and that the password is not longer than 127 bytes. Non-English characters take more than one byte each, so a long passphrase in some languages reaches the limit sooner than you would expect.

The tool says the file is already protected. A PDF that is already encrypted has to have its password removed before it can be processed again. Start from the unprotected original instead.

The recipient cannot open the file. Make sure they are using a current PDF viewer. Most modern browsers and readers support AES-256, but very old software may not. Also check that you sent the right password and that no spaces were added when it was copied.

A viewer still lets someone print or copy. The permission toggles rely on the viewer honoring them. Some tools ignore the flags. If it matters, do not share the password, because the contents stay unreadable without it.

I want to shrink the file as well. Compress first, then protect. An encrypted file cannot have its structure rewritten, so Compress PDF needs the unprotected version.

Frequently asked questions

What happens if I forget the password? There is no recovery. Because the file is genuinely encrypted, a forgotten password means the contents cannot be read. Keep a copy of the original somewhere safe.

Is the password or file sent anywhere? No. Both the file and the password stay in your browser; nothing is uploaded.

How strong is the encryption? The PDF is encrypted with AES-256. Your protection is only as strong as the password you choose, so make it a good one.

Can I protect a PDF offline? Only in a page that is already open. Once the encryption engine has downloaded on first use, an open page keeps working if your connection drops, and encrypting runs on your device. Opening or reloading the page needs a connection.