This page's code did not start.

Opening index.html directly from a folder blocks JavaScript modules, so nothing will happen when you choose a PDF. Serve the folder over http instead:

powershell -ExecutionPolicy Bypass -File serve.ps1

Then open http://localhost:8080/.

PDF Protector

Lock a document you would rather not hand to a website in order to lock it.

Language: English
View source
Your documents are processed in your browser. No processing upload.

The document you choose is opened, encrypted and written back out in memory on this machine, by code served from this address. Nothing here can make an upload, and there is no server on the other end of this page to receive one. Neither the file nor the password you type leaves the tab.

Live check: checking…

Offline: checking…

Don't take our word for it: open DevTools, watch the Network tab, and protect something. Not one request carries a document, a password, or a filename. Or unplug from the internet and protect it anyway.

1 Choose the PDF

2 Choose the password and the restrictions

The password is the lock: the document is encrypted with a key made from it, and nobody without it reads a word. The restrictions underneath are different — a request that readers honour by agreement, and that any reader may decline. You can set either, or both.

No printing Neither at full quality nor as a coarse picture.

No copying Text and pictures cannot be selected and copied out. Reading it aloud to somebody who cannot see it stays allowed.

No changes No editing, no comments or highlights, no filling in forms, no adding, removing or reordering pages.

There is no way back in without this password. Nothing here guesses one, and nothing honest anywhere does either. Keep your original.

Restrictions

These ask a reader not to do something. Most readers listen; none is made to, and a document that opens without a password can always have them lifted. Tick them to say what you would like, not to make sure.

Which encryption

3 Protect it

View as Markdown

How to put a password on a PDF, or restrict it

  1. Choose the PDF. One document at a time. It is read straight off your disk by the browser and opened here. A document that already needs a password is turned away with a link to the unlocker; one that only carries restrictions is accepted, and what you set below replaces them.
  2. Set the password to open it, and type it again. This is the real lock. Whoever has this password reads the document; nobody else does, and nothing here or anywhere honest will recover it if it is forgotten. The two boxes have to agree before the button wakes. Leave both blank if all you want is restrictions on a document that still opens for everybody.
  3. Tick the restrictions, if you want any. Printing, copying text and pictures out, and changing the document. These are requests that well-behaved readers honour, not encryption, and the page says so beside the boxes. An owner password lifts them; if you leave that box blank the open password does both jobs, and if you set no password at all a random one is used and thrown away, so the restrictions cannot be lifted by trying nothing.
  4. Protect it, and read the line that says it was checked. The document is written back out enciphered under a fresh key. Then the finished file is opened again here twice — once with no password, where it has to be refused, and once with yours, where it has to open with the same number of pages — and if either check fails you get no download and a message saying so.

The longer version

How to password-protect a PDF, and what it is actually worth A password on a PDF is a real lock. A restriction on printing is a request. What each one does, which encryption to choose, why the upload is the strange part of every online tool, and what happens if you forget the password.

Questions

Is a password-protected PDF actually secure?

With the default here, yes, exactly as secure as the password: AES-256 under the PDF 2.0 password hash is the current scheme and there is no shortcut through it. What is worth knowing is that not every "password protected" PDF was made this way. The format has been through five generations, from a 40-bit key in 1994 that a laptop can search outright to this one, and readers report them all with the same words. This page writes the strongest, and names the other one it can write for what it is.

What is the difference between the password and the restrictions?

A PDF has room for two passwords. The user password is the one a reader asks for; without it the file does not open, and that is real. The owner password lifts the restrictions — printing, copying, editing — and those are a request. A document that opens without a password must contain everything needed to derive its own key, so the only thing stopping a reader from printing it is a field it has agreed to honour, and any reader may decline. The PDF Unlocker on this site is one that declines. Set restrictions to say what you would like; set a password to make sure.

What if I forget the password?

Then the document is lost, and it is better to hear that here than from a "password recovery" site that takes your file first. Nothing on this site guesses passwords — you can read src/shared/pdf-crypt.js and see there is no loop in it — and for a document locked with the default scheme, nothing honest anywhere would succeed. That is why the page asks for the password twice. Keep your original: it is not changed by this, and it is the copy you will want if the password is ever gone.

Should I choose AES-256 or AES-128?

AES-256, unless a reader from before 2010 has to open the file. The 256-bit option is the PDF 2.0 scheme — Acrobat X and later, every browser, every phone, every current reader. The 128-bit option is the 2005 scheme, which those older readers understand, and it is weaker not because of the cipher but because of the 1994 key derivation in front of it, which makes guessing a password far cheaper than the cipher suggests. If you do not know which reader will open the file, choose 256.

Can I protect a PDF that is already protected?

If it opens without a password and only carries restrictions, yes: drop it in, and what you set replaces what was there. If it asks for a password to open, this page turns it away and points at the PDF Unlocker, which takes the old protection off in the same browser; bring the unlocked copy back here for the new one. Two locks on one document is not something the format can express, so changing a password is always take-off-then-put-on.

Will the document look any different afterwards?

No. Nothing is re-rendered, re-encoded or reflowed: every page's drawing instructions, every embedded font and every image is copied through exactly as it arrived, enciphered. For whoever has the password, text stays selectable, scans stay at their original resolution, and nothing moves. The file may come out slightly smaller, because a rewrite leaves behind the superseded copies of objects that earlier edits left in it, and slightly larger where encryption adds sixteen bytes to every stream.

What happens to a signed document?

Its signature stops being valid, and there is no way round that. A signature covers the exact bytes of the file it was applied to, so any change at all — by any program, including the one that signed it — invalidates it. This tool writes a new file, notices when the original was signed, and says so on the results. If you need a document that is both signed and protected, protect it first and sign the protected copy.

Are my documents or passwords uploaded anywhere?

No. The file is read, encrypted and written by your own browser on your own hardware, and the password goes into a key derivation running in this tab. There is no server side to this tool, and the page's Content-Security-Policy names every address it may contact — none of them belongs to this site. The simplest way to satisfy yourself is to unplug from the network and use the page anyway. On this tool of all tools, that is the point: a document you are locking is one you would rather not hand round first.

How do I know the protection is really on?

Because the tool checks, on your machine, and shows you the result. When the file has been written it is handed back to the same reader that the other PDF tools on this site use, twice. With no password it has to be refused outright; with the password you set it has to open, come back with the same number of pages, and report the restrictions you ticked. If either check fails, the run is reported as failed and nothing is offered for download. You can check it yourself afterwards too: open it in any reader, which will ask for the password, and look at the document properties for the permissions.

Is there a size limit, and does it cost anything?

There is no limit written into the tool. The limit is your own machine: the document is held in memory while it is worked on, so a laptop will take a few hundred megabytes without complaint and will struggle somewhere above that. It is free, there is no account, no sign-in and no trial. The site carries advertising, which is what pays for it; the ads are not given anything about your documents.

Does it work offline?

Yes. Load the page once, then disconnect from the internet and it keeps working. That is also the simplest way to prove nothing is being uploaded: a tool that sent your document away to be encrypted would stop the moment you unplugged.