Add Password to PDF

Lock any PDF with a strong password — 256-bit encryption, locked files supported, and everything runs in your browser

Drop your PDF here

or click to browse

Supports: PDF files (locked or unlocked)

How to add a password to a PDF

1

Upload your PDF

Drag & drop a PDF or click the upload area. Locked PDFs are supported too.

2

Create a strong password

Enter and confirm your new password. If the PDF is locked, enter the current password too.

3

Encrypt your PDF

Click “Add Password & Download”. We’ll secure your document with strong encryption and prepare it for download.

4

Download protected PDF

Save the password-protected PDF to your device.

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.

Add Password to PDF FAQ

Is it safe to add a password to a PDF online?

Yes, when you use a tool that processes the file locally. This page encrypts your PDF in the browser with QPDF WebAssembly inside a Web Worker. The document is not uploaded to a MyPDF Guru server for conversion. Use a trusted device and browser, and keep your password private after sharing the file.

Is my PDF uploaded to a server?

No. The file is read with the browser File API and encrypted on your device. The protected PDF is created as a browser download. There is no server-side conversion request for this tool.

Can I add a password to an already locked PDF?

Yes, if you know the current password. Enter it in the current-password field, verify it, set a new password, confirm it, and download the re-protected PDF. Without the correct current password, the tool cannot open the file to apply a new lock.

What is the difference between 256-bit and 128-bit encryption?

256-bit is stronger and is the recommended default. 128-bit is an older, lighter setting that may be useful for compatibility or on devices where encryption feels slow. Both options add real PDF password protection; the main difference is strength and how demanding the operation may be on your browser.

Will the PDF quality or content change?

No. Password protection only adds encryption. The pages, text, images, and layout remain the same. The file simply requires a password to open.

What password should I use?

Use a password you can remember or store safely, but make it hard for others to guess. A strong choice is 12 or more characters with uppercase and lowercase letters, numbers, and symbols. The built-in strength meter helps you see whether your password is weak or strong.

Can I use a short or weak password?

Yes. The tool requires a non-empty password that matches the confirm field, but it does not force a minimum length. For real documents, a stronger password is strongly recommended because short passwords are easier to guess.

What happens if I enter the wrong current password?

For a locked PDF, the status may show that the current password could be wrong, and encryption will fail if the password is incorrect. Double-check caps lock and spelling, then try again. The page does not verify the current password on every keystroke; it checks when you leave the field.

Why is the Add Password button disabled?

The button stays disabled until a PDF is loaded, the new password is not empty, both password fields match, and — for locked PDFs — the current password field is filled in. Whitespace-only passwords are not accepted.

What will the downloaded file be named?

The protected PDF uses the original name with _protected.pdf added. For example, report.pdf becomes report_protected.pdf. Your original file is not overwritten.

Will my original PDF be changed?

No. The tool reads the original and creates a separate protected copy. Your source PDF stays unchanged on your device.

Can I remove the password later?

Yes, if you still know the password. Use our PDF Password Remover to create an unlocked copy. If you forget the password, this tool cannot recover it for you.

Is there a file size limit?

There is no fixed limit set by the page itself. Very large PDFs depend on your device memory and browser. If encryption fails on an unusually large file, try a smaller document, close other tabs, or use 128-bit encryption on an older device.

Does it work on mobile phones?

Yes. The layout is responsive on phones, tablets, and desktop. Tap the upload area to choose a PDF from your files app. Large files may take longer to encrypt on mobile because the work runs entirely on your device.

Do I need to create an account?

No. You can upload a PDF, set a password, and download the protected file without signing up.

Why does encryption take longer the first time?

The page loads QPDF as WebAssembly inside a worker. The worker is warmed up after the page loads, but the first encryption may still need extra time while the engine initializes. Later runs on the same page are often faster.

What if my PDF cannot be opened or encrypted?

The file may be damaged, use unsupported encryption, or need a password you do not have. The tool shows an error message and lets you clear the file and try another PDF. For locked files, make sure the current password is correct before clicking protect.