Skip to content
YardMaths PDF

Add a password to a PDF

Real AES 256-bit encryption, tested before you download.

Drop a PDF file here

or drag it here, or paste it.

Privacy: your files are opened and processed by your browser, on this device. They are never uploaded to YardMaths or anyone else, and they are gone when you close the tab.

How to password protect a PDF

  1. Choose the PDF you want to lock, or drop it on the box.
  2. Type a new password in both boxes. It needs at least 6 characters; 12 or more, or four random words, is much safer.
  3. Press Protect PDF. Your browser encrypts the file, then reopens the copy to check that it refuses no password and a wrong one, and opens with yours.
  4. Download the protected copy and store the password somewhere safe. Your original file is not changed and stays unlocked.

Why this tool runs in your browser

Putting a password on a file only makes sense if nobody else sees the file before it is locked. With an upload service, the unlocked document and the password you chose both reach someone else's server first. On this page the encryption runs in your browser: the PDF and the password stay on your device, and only you get the locked copy.

The page also proves the lock before you rely on it. Right after encrypting, it opens the new file with a separate PDF reader three times: without a password (it must refuse), with a wrong password (it must refuse) and with yours (it must open with the same pages). If any of these checks fails, you get a message instead of a file.

What this protection does

  • Encrypts the contents of the file with AES 256-bit, the strongest method in the PDF 1.7 standard (extension level 3).
  • Sets an open password: the pages cannot be viewed until it is typed.
  • Sets no separate permissions password: anyone who has the password can print, copy and edit the file.
  • Keeps the pages, text, links, bookmarks and form fields as they were: they are only encrypted.

Limits to know before you start

  • The lock is only as strong as the password. Short or common passwords can be found by programs that try many guesses, so use a long one.
  • This tool sets an open password only. It does not add printing or copying restrictions, which PDF readers are free to ignore anyway.
  • If you forget the password, the copy cannot be opened. Nobody can recover it, including YardMaths.
  • It uses the AES 256-bit method of PDF 1.7. Very old PDF readers made before that method existed cannot open the copy.
  • A PDF that already has a password must be unlocked first. A digital signature in the file stops being valid once the copy is encrypted.

Protect PDF FAQ

What encryption does this PDF password tool use?

AES with a 256-bit key, as defined for PDF 1.7 (extension level 3). The whole content of the file is encrypted, not just hidden behind a prompt, and the copy is tested with a separate reader before you download it.

Can I set a password that only blocks printing or copying?

Not with this tool. It sets a password to open the file, which is the kind that actually protects the content. Printing and copying limits depend on the reader honoring them, so they are not offered here.

How long should a PDF password be?

The longer the better. Six characters is the minimum here, but 12 or more characters, or four or five random words, is far harder for guessing programs. Avoid names, dates and words linked to the document.

Does adding a password make the PDF bigger?

Usually only by a tiny amount. Encryption adds a small security section, and the file is rewritten, so it can even end up slightly smaller. Your pages are not recompressed.

Is my new password sent anywhere when I lock the file?

No. The password is used by your browser to encrypt the file on your device and is not saved or sent. Closing the tab clears it from memory.

Last updated . Free to use, no sign-up.