# Password Protect PDF

> A free online tool that adds a password to a PDF by encrypting it with AES-256: an owner password (required), an optional password to open the file, and print, copy and edit permissions; it does not remove or recover passwords.

Password Protect PDF files with this free tool: it adds a password to one PDF and encrypts it with AES-256. This tool only adds a password. It does not remove, unlock, find or recover passwords. You get a new file with the same pages, and your original file stays unchanged.

## Key facts

- Input: one PDF up to 10 MB without an account (50 MB signed in), up to 100 pages (500 signed in); a PDF that is already encrypted is refused, and nothing here removes a password.
- Passwords: 6 to 127 characters of printable ASCII, the two passwords must differ; permission limits (print, copy, edit) depend on the program that opens the file, and only the password to open the file keeps people out; we cannot recover a lost password.
- The passwords travel to our server over HTTPS, wait in the processing queue only in encrypted form, are never written to the database or the logs, and are deleted when the job ends.
- In our test a generated 6 page PDF of 51 KB gave a 53 KB protected PDF that qpdf refused to open without the password and reported as 6 pages with the password; results vary with the file.
- API: POST the PDF to https://api.aiipworld.com/v1/uploads, then POST https://api.aiipworld.com/v1/pdf-jobs with op pdf_protect, owner_password and the upload id, and poll GET /v1/jobs/:id.
- Free without an account: 20 PDF jobs per day per visitor. Signed in, each job costs 1 credit, plus 1 credit for each started 20 MB of result beyond the first 20 MB (100 free credits every month).
- Files are deleted automatically: 10 minutes after conversion without an account, 1 day with a free account.

## How it works

1. Upload one PDF.
2. Enter an owner password of 6 to 127 characters. You need it to change the protection later.
3. Optionally enter a password to open the file. Leave it empty if anyone should be able to open it.
4. Choose which actions people may do: print, copy text, or edit. All three are ticked by default.
5. Start the job and download protected.pdf from the result panel.

## How to password protect PDF files

Start with a copy of the PDF you want to protect. Upload it, set an owner password, and decide whether you also want an open password. The tool then creates a new file called protected.pdf with the same pages. Your original file is not changed.

Follow these steps to learn how to password protect a PDF with the web tool. Check the result panel for the output and download link. Results vary with the file, and the examples we measured were generated test files, not real documents.

- Keep the original file in a safe place.
- Test the new file once before you share it.

## Two passwords: open and owner

The owner password is required. It controls the permissions and is needed to change the protection later. It must be 6 to 127 characters.

The password to open the file is optional. If you fill it in, the file asks for it every time it is opened. If you leave it empty, anyone can open the file, and only the permission limits apply. The two passwords must be different.

## What people may do: print, copy, edit

Three checkboxes control what people may do: print, copy text, and edit. All three are ticked by default. Unticking edit also switches off changing pages, notes and form fields.

These limits are a request only. The program that opens the file decides whether to follow them, and some programs ignore them. Screen readers keep access to the text. In one test, a file with only an owner password and printing switched off opened without a password and reported printing as not allowed.

## Encryption: AES-256

The PDF password protection here uses AES-256, the 256-bit AES encryption of PDF 2.0. Use it when you need to encrypt pdf file copies before you share them. The encryption is done with qpdf, a command-line PDF program that runs as a separate process. The new file reports R = 6 and AESv3.

In our test, we generated a 6 page PDF of 51 KB and protected it with an owner password and a different open password. The result was a 53 KB PDF of 6 pages. We checked it with qpdf, a command-line PDF program. Without a password, qpdf reported "invalid password" and gave no page count. With the open password it reported 6 pages, and the file showed R = 6 and AESv3 encryption. Sizes shown here are measured on generated files, so your results will vary.

## What happens to your passwords

Your passwords are sent to our server over HTTPS. While the job waits in the processing queue, they are stored only in encrypted form, sealed with AES-256-GCM.

They are never written to the database, the usage records, the job view or the logs, and they are not in the result. The worker deletes them when the job ends. For a short moment they are written to a private temporary file for the encryption program, which is then removed.

## Lost passwords and removing passwords

We cannot recover a lost password. Keep your original file and write your passwords down before you share the protected copy.

This tool does not remove passwords. It only adds protection. If you need to change the protection later, you need the owner password. Use your original file if you ever need to start again.

## Limits: size, pages and credits

Without an account, you can protect one PDF up to 10 MB and 100 pages. Signed-in users can protect up to 50 MB and 500 pages.

Free web tool jobs are limited to 20 per day per visitor. Signed-in users pay 1 credit per job, plus 1 credit for each started 20 MB of the result beyond the first 20 MB. Failed and timed-out jobs are refunded in full.

## Already encrypted or damaged files

A PDF that is already encrypted is refused. This includes files with a password to open or with permission limits. No password is accepted, and no attempt is made to open or break the protection.

If a file is slightly damaged, it is repaired automatically when possible, and the result panel says so. The setting "Repair a slightly damaged PDF automatically" is on by default. If it is off, a damaged file is refused.

## Password protect PDF from code

You can password protect a PDF from code with the API. First send the raw file to https://api.aiipworld.com/v1/uploads with Content-Type application/pdf. The answer includes an upload_id.

Then send a POST to https://api.aiipworld.com/v1/pdf-jobs with JSON containing op pdf_protect, your params, and files with the upload_id. Poll GET /v1/jobs/:id until the job succeeds, fails or times out. Use an Authorization: Bearer header with your API key, or x-api-key. The page shows a ready cURL, Node and Python example built from your settings. Common errors include 400 invalid_params, 413 file_too_large, 422 not_a_pdf, 402 insufficient_credits, and a failed job with error_code encrypted_pdf or bad_params.

## Privacy: what happens to your file

The file is sent to our server, where it is processed. It is used only to make the result. The working copy of your upload is deleted as soon as the job ends, whether it succeeds or fails.

The result is deleted after 10 minutes in the free web tool. No history is kept, and download links are short-lived. You must have the right to use the files you upload under our Acceptable Use Policy.

## Questions

### Can I password protect a PDF for free?

Yes, you can password protect a PDF for free in the web tool, with no signup, within the daily limit of 20 jobs per visitor.

### Do I need both passwords?

No. The owner password is required, and the password to open the file is optional.

### What is the owner password for?

It controls the permissions and is needed to change the protection later. It must be 6 to 127 characters.

### Can people still print or copy if I switch the permissions off?

Possibly. The print, copy and edit limits are only a request, and some programs ignore them. Only the password to open the file keeps people out.

### What happens if I forget the password?

We cannot recover a lost password. Keep your original file and write your passwords down.

### Can I remove the password later with this tool?

No. This tool only adds a password and does not remove, unlock or recover one.

### Is my password stored?

Your passwords are sent over HTTPS and held only in encrypted form while the job waits. They are never written to the database, usage records, job view or logs, and the worker deletes them when the job ends.

### Can I protect a PDF that is already protected?

No. A PDF that is already encrypted is refused, and no password is accepted for it.

### Which characters can the password use?

Printable ASCII only: letters, digits, punctuation and spaces from a basic English keyboard. Passwords cannot have accented or non-Latin letters, start or end with a space, or start with a hyphen.

### Can I password protect a PDF in my own code?

Yes. Use the API with op pdf_protect, send the file to the uploads endpoint first, then create a job and poll until it finishes.

## Related

- [Watermark PDF](https://aiipworld.com/tools/watermark-pdf/index.md)
- [Merge PDF Files Online for Free](https://aiipworld.com/tools/merge-pdf/index.md)
- [Split PDF Online, Free](https://aiipworld.com/tools/split-pdf/index.md)
- [Add Page Numbers to PDF](https://aiipworld.com/tools/add-page-numbers-to-pdf/index.md)
- [Delete Pages from PDF](https://aiipworld.com/tools/delete-pdf-pages/index.md)
- [Unlock PDF: Remove the Password from Your PDF](https://aiipworld.com/tools/unlock-pdf/index.md)
- [Flatten PDF](https://aiipworld.com/tools/flatten-pdf/index.md)

Page: https://aiipworld.com/tools/protect-pdf/
