Add Password to PDF Online: A Complete Guide to Locking Your Documents
A PDF without a password can be opened by anyone who receives the file. MyPDF Guru’s free password adder lets you lock a PDF with encryption so only people who know the password can open it. Upload your file, choose a password, pick an encryption level, and download a protected copy. The original PDF on your device is never changed.
What this PDF password tool actually does
Adding a password to a PDF is not the same as hiding a file inside a folder. The tool applies real PDF encryption to the document. After protection, a PDF reader will ask for the password before it shows the pages. The text, images, layout, and page count stay the same — only access control is added.
This is useful for contracts, invoices, bank statements, medical records, school assignments, business proposals, and any document you send by email or upload to a portal but do not want strangers to read. If you own the file and want to control who can open it, password protection is a simple first step.
Upload a PDF by clicking or dragging
Start by clicking the upload area and choosing a PDF from your device, or drag a PDF onto the drop zone. The page accepts PDF files only. If you select or drop another file type, the tool stops and shows an invalid-file message instead of trying to process it.
Both unlocked PDFs and PDFs that already have a password are supported. After you choose a file, the page reads it locally and shows a short upload progress bar while it analyzes the document.
The page checks whether your PDF is locked
After the file is read, the tool uses PDF.js to open the document in your browser and count its pages. If the PDF opens without a password, the status shows Unlocked PDF and the page count appears in the file details panel. You can then move straight to creating a new password.
If the PDF is already encrypted, PDF.js raises a password exception. The tool detects this and shows Locked PDF (needs current password). A current-password field appears because the page must know the existing password before it can apply a new one. Until the correct password is entered, the page count may stay blank.
If the file is damaged or uses encryption that cannot be read, the tool shows an error and resets the screen so you can try another file.
Enter the current password for locked PDFs
When your PDF is already protected, type the password that currently opens it into the Current password field. The tool does not verify this on every keystroke. Instead, it checks the password when you leave the field. If the password is correct, the status changes to Locked PDF (password verified) and the page count is filled in.
If the password is wrong, the status may show Locked PDF (wrong current password?). In that case, check spelling, caps lock, and whether the PDF uses a different password than you expect. The protect button stays disabled until a valid new password is entered and, for locked files, until the current password field is not empty.
Whitespace-only passwords are rejected. A field filled with only spaces will not enable protection.
Create your new password
Enter the password you want people to use when opening the protected PDF. Then type the same password again in the Confirm new password field. Both values must match before the Add Password & Download button becomes active.
The tool allows any non-empty password, including short ones, but a strong password is always better for real documents. A good rule is to use at least 12 characters with a mix of uppercase letters, lowercase letters, numbers, and symbols. Avoid obvious words, birthdays, or the file name itself.
Each password field has a show/hide button (eye icon) so you can check what you typed without guessing from dots.
Use the built-in password strength meter
As you type the new password, a four-segment strength meter updates in real time. It looks at password length and whether the text includes lowercase letters, uppercase letters, numbers, and symbols. The label beside the meter shows Weak, Fair, Good, or Strong.
The strength meter is a guide, not a hard rule. The tool will still let you protect a PDF with a weaker password if you choose to. For sensitive files, aim for Good or Strong and store the password somewhere safe — if you forget it, you may need our PDF Password Remover later, and that only works when you still know the password.
Confirm that both passwords match
Below the confirm field, a hint tells you whether the two passwords match. When they match, the hint turns green and says Passwords match. When they do not match, it warns you so you can fix a typo before clicking protect. This small check prevents downloading a locked PDF that you cannot open because of a typing mistake.
Choose 256-bit or 128-bit encryption
The Encryption level menu offers two choices:
- 256-bit (Recommended): stronger protection and the default choice for new documents.
- 128-bit (Compatibility): older or lighter encryption that may work better on some devices or with very large files if the browser struggles.
The selected key length is sent to the encryption engine when you click protect. For most everyday PDFs, keep 256-bit selected. Switch to 128-bit only if protection fails or feels unusually slow on an older phone or computer.
Encryption runs in a browser Web Worker with QPDF
When you click Add Password & Download, the PDF bytes are passed to a dedicated Web Worker that runs QPDF compiled to WebAssembly. The worker encrypts the file on your device and returns the protected bytes. This keeps heavy work off the main browser thread so the page stays more responsive.
The worker is warmed up shortly after the page loads, so the QPDF engine can be ready before you click protect. The first encryption may still take a moment while WebAssembly initializes, especially on slower devices or with larger PDFs.
For locked PDFs, the worker receives both the current password and the new password. For unlocked PDFs, only the new password is needed. The engine writes a new encrypted PDF and hands it back to the page for download.
Follow the progress bar
During encryption, a progress bar appears with messages such as Preparing encryption... and Encrypting with 256-bit... (or 128-bit, depending on your choice). The protect and clear buttons are disabled temporarily so the same job cannot start twice by accident.
If encryption fails — for example, because the current password for a locked PDF was wrong — the tool shows an error in a popup and hides the progress bar. You can correct the password and try again without reloading the page.
Review file details before you protect
The file details card shows the file name, file size, page count, and current status. Use it to confirm you selected the right document before adding a password. For unlocked PDFs, the page count appears as soon as analysis finishes. For locked PDFs, the count appears after the current password is verified.
Download a separate protected copy
When encryption completes, the browser creates a new PDF and starts the download automatically. The file name is based on the original name with _protected.pdf added. For example, invoice.pdf becomes invoice_protected.pdf. Your original file remains unchanged on your device.
Open the downloaded PDF in your usual reader and confirm that it asks for the new password. Keep a backup of the original unlocked copy in a safe place until you are sure the protected version works as expected.
Clear the page and start again
The Clear file button removes the current PDF, password fields, strength meter, and progress state from the page. A confirmation message appears first so an accidental click does not erase your work. After clearing, the upload area returns and you can protect another document.
Your PDF stays in the browser
This tool reads the selected file with the browser File API and encrypts it locally through a Web Worker running QPDF WebAssembly. The PDF is not sent to a MyPDF Guru conversion server. The result is created as a browser Blob and downloaded directly to your device.
For confidential documents, use an updated browser and a trusted device. Password protection limits who can open the file, but it does not stop someone from sharing the password itself. Choose a strong password and share it only through a secure channel.
Works on desktop, tablet, and phone
The same upload, password, encryption, and download flow works on computers and mobile browsers. On a phone, tap the upload area and pick the PDF from your files app. Drag and drop is mainly for desktop. Large PDFs may take longer on a phone because encryption needs memory and processor time.
When should you password-protect a PDF?
Password protection is useful before emailing a contract to a client, uploading tax or salary documents, sharing student records, sending a medical report, distributing an internal memo, or posting a PDF to a shared drive where you want an extra access barrier. It is also helpful when you want to replace an old password on a PDF you already own.
Password protection is not a substitute for every security need. It does not stop someone from deleting the file, and it does not add a visible watermark. For a visible “CONFIDENTIAL” mark, use the PDF Watermark tool first, then return here to lock the finished document.
Common next steps after protecting a PDF
After locking a document, you may want to compress the PDF if the protected file is too large to email. If you need to edit text or add notes before protection, use the PDF Editor. If you later need to remove the password and you still know it, use the PDF Password Remover to create an unlocked copy.
Choose a strong password, confirm it carefully, pick the encryption level that fits your device, and test the downloaded file before sharing it. MyPDF Guru’s browser-based password adder gives you real PDF encryption without an account or a server upload for conversion.