Unlock PDF
Published Updated
Unlock a PDF you have the password for: type the password and save a copy that opens without a prompt.
You need the password; the tool removes the lock
A password-protected PDF is encrypted. This tool decrypts it with the password you supply and saves a copy with no encryption, so it opens without a prompt and no longer carries the original's permission settings. It cannot recover a forgotten password. Use it only on files you own or have the right to open and change; removing permissions an owner has set can breach a licence or the law. The tool does not guess or crack passwords.
Some PDFs open without any password but carry permission settings that block printing, copying or editing. Those have only an owner password and an empty open password, so the tool accepts an empty box for them; the rights note above applies to them too.
What was tested
Test files were made from a two-page PDF with pikepdf, each with a different encryption setting, and run through the same calls the tool makes (@cantoo/pdf-lib, a pdf-lib fork that can decrypt). The output was then opened with pikepdf without a password.
| Encryption | Password typed | Result |
|---|---|---|
| AES 256-bit, open password set | the open password | Decrypted, opens without a password |
| AES 256-bit, open password set | a wrong one | Incorrect password message |
| AES 256-bit, open password set | the owner password | Decrypted |
| AES 128-bit | the open password | Decrypted |
| RC4 128-bit | the open password | Decrypted |
| RC4 40-bit | the open password | Decrypted |
| AES 256-bit, permissions only | nothing | Decrypted; permission settings not kept |
| RC4 128-bit, permissions only | nothing | Decrypted; permission settings not kept |
Encryption and permissions are defined in section 7.6 of the PDF specification.
Protected test files in four browsers: what each password did
We ran the site's own Unlock PDF component in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app). The protected files were made with pikepdf 9.11.0 (libqpdf 12.2.0) from one generated two-page PDF with two bookmarks, a link, a filled form field and a title, using made-up test passwords; one more was protected with this site's own Protect PDF code. Every copy that came out was opened again with pikepdf and pypdf 6.18.1. All four engines gave the same result in every row:
| Test file | Open password | Owner password | Wrong password | Box left empty |
|---|---|---|---|---|
| RC4 40-bit (revision 2) | Decrypted | Decrypted | Incorrect password. Please try again. | Incorrect password. Please try again. |
| RC4 128-bit (revisions 3 and 4) | Decrypted | Decrypted | Incorrect password. Please try again. | Incorrect password. Please try again. |
| AES 128-bit (revision 4) | Decrypted | Decrypted | Incorrect password. Please try again. | Incorrect password. Please try again. |
| AES 256-bit, revision 5 (an early AES-256 scheme that pikepdf flags as deprecated) | Decrypted | Decrypted | Incorrect password. Please try again. | Incorrect password. Please try again. |
| AES 256-bit, revision 6, also with metadata left unencrypted, with compressed object streams, and with both | Decrypted | Decrypted | Incorrect password. Please try again. | Incorrect password. Please try again. |
| AES 128-bit with metadata left unencrypted, and RC4 128-bit with compressed object streams (revision 4) | Decrypted | Decrypted | Incorrect password. Please try again. | Incorrect password. Please try again. |
| Print and copy restrictions only (RC4 128, AES 128 and AES 256, the last also with compressed object streams) | None set | Decrypted | Incorrect password. Please try again. | Decrypted; permission settings not kept |
| The accented password pässwort-1 (RC4 128-bit and AES 256-bit) | Decrypted | Not tried | Not tried | Not tried |
| AES 256-bit from this site's Protect PDF | Decrypted | Random, not known | Incorrect password. Please try again. | Incorrect password. Please try again. |
An empty box helps only when the file has no open password. With one, leaving the box empty gives the same Incorrect password message as a wrong password. A file with no encryption gave This PDF does not appear to be password protected. whatever was typed, and the AES-256 file cut to 70% of its length, like 4,000 random bytes named .pdf, gave the tool's general error, Something went wrong ... Please check the file and try again.
What the decrypted copy keeps, and the metadata it can lose
| Part of the file | In the decrypted copies (read back with pikepdf and pypdf) |
|---|---|
| Encryption | None: pikepdf and pdf-lib opened every copy without a password |
| Pages and page text | Both pages, with page 1 text the same as in the protected original |
| Bookmarks, link, filled form field | All kept: two bookmarks, the same link address, the field value Field value 42 |
| Document title in the Info dictionary | Kept in every copy, including the four files whose objects were packed in compressed object streams |
| XMP metadata | Kept and readable in every copy, including the five files that stored it as plain text (two AES-256 files with metadata left unencrypted, one of them also in object streams, one such AES-128 file, and the two RC4 128-bit revision 4 files) |
| File identifier (the ID pair in the trailer) | Kept in every copy |
| Producer, creator, dates | Producer and creator set to pdf-lib; creation and modification dates added |
| Size | 2,477 to 3,356 bytes, from protected files of 2,343 to 4,530 bytes (the unprotected original was 2,635); the copies of the RC4 revision 2 and 3 files and of the RC4 file packed in object streams came out larger than the protected files, the others smaller |
| A 56 MB, 40-page AES-256 scan-like file | The first page's JPEG data, 1,340,931 bytes, had the same SHA-256 as in the unprotected original |
Two parts of a protected file can be stored without encryption while everything else is encrypted. The PDF specification (ISO 32000-1:2008) says "The cross-reference stream shall not be encrypted", and an EncryptMetadata entry set to false leaves the document's XMP metadata stream unencrypted. The tool reads those two parts from the file as stored, without running them through decryption, which is how the title, the file identifier and the XMP packet came through in the copies above. The test files were generated: no real bank statements or other documents, and no file protected with a certificate (public-key) instead of a password, which this tool was not tested with.
How long decryption took
Timed in the page from pressing Unlock PDF until the download link or the message appeared, one run per file, engines Chrome 156, Chromium 153, Firefox 155 and the WebKit build:
| Engine | Two-page test files, all kinds | Messages (wrong or empty password, damaged file) | 56 MB, 40 pages, AES-256 (two runs) |
|---|---|---|---|
| Chrome 156 | 11 to 245 ms | 10 to 141 ms | 3,338 and 3,205 ms |
| Chromium 153 | 11 to 196 ms | 11 to 116 ms | 2,941 and 2,834 ms |
| Firefox 155 | 10 to 312 ms | 10 to 149 ms | 4,070 and 5,684 ms |
| WebKit build | 10 to 78 ms | 10 to 50 ms | 1,697 and 2,001 ms |
Among the small files, the AES-256 revision 6 ones were the slow end (for example 117 ms in Chrome 156 with the open password, against 11 to 47 ms for the RC4 and AES-128 files there).
Removing the password
Step 1
Add the protected PDF
Nothing is decrypted yet. When you press the button, the tool first checks whether the file is encrypted at all.
Step 2
Type the password
Enter the password that opens the file, or leave the box empty if the PDF opens without one but blocks printing or copying.
Step 3
Save the decrypted copy
With the right password the file is decrypted and saved again without encryption. A wrong one gives an Incorrect password message.
Use it on files you are allowed to open
Removing protection from a document you have the password for is routine, such as a bank statement you want to archive without a prompt. Removing it from someone else's file can break the terms under which it was shared. To add a password instead, use Protect PDF.
Removing a PDF password: questions
Can it remove a password I do not know?
No. It decrypts with the password you type and has no way to guess or crack one. If the password is lost, ask whoever made the file for an unprotected copy.
My PDF opens fine but I cannot print or copy from it. Will this help?
Technically, yes, as long as the file opens without a password. Those files have only an owner password that sets permissions, while the open password is empty. In our tests an empty box decrypted them, and the copy no longer carried the permission settings. Use it only on files you own or have the right to open and change; removing permissions an owner has set can breach a licence or the law. The tool does not guess or crack passwords.
Which kinds of PDF encryption work?
In tests with files made by pikepdf, all four common kinds opened with the right password: 40-bit and 128-bit RC4, 128-bit AES and 256-bit AES. The owner password worked as well as the open password.
Does the decrypted copy look different?
Not on the page. In our tests the pages, page text, bookmarks, a link, a filled form field, the title, the file identifier and the XMP metadata came through, read back with pikepdf, also from files that kept their XMP metadata unencrypted or packed their objects in compressed object streams. The PDF library sets the producer and the modification date, and adds a creator and a creation date where the file had none.
Why does it say the PDF does not appear to be password protected?
The file has no encryption dictionary, so there is nothing to remove, and the tool stops rather than saving an identical copy. Check that you added the file that asked for a password.
Is my password sent anywhere?
The password and the PDF are handled by JavaScript in this tab, and decryption happens on your device. The tool's code makes no network request, and in our test runs, which logged every request, none carried the password or the file.
Why does it say Incorrect password when I left the box empty?
Because the file has an open password. An empty box works only for files that open without one and merely restrict printing or copying. Every test file with an open password gave Incorrect password. Please try again. for an empty box, the same message as for a wrong password.
Does a password with accented letters work?
The password pässwort-1 opened an RC4 128-bit file and an AES 256-bit file in all four engines we ran. Passwords in other scripts, such as Greek or Japanese, were not tested.
How long does a large protected PDF take?
A 56 MB, 40-page AES-256 test file took 1.7 to 5.7 seconds (two runs per engine): 1.7 and 2.0 seconds in the WebKit build, 2.8 to 3.3 in Chrome 156 and Chromium 153, and 4.1 and 5.7 in Firefox 155, on one Mac. Two-page files took well under a second.
Can it open a PDF protected with this site's Protect PDF?
Yes, with the password that was set there. A file protected with the site's AES-256 code opened with its password in all four engines, and a wrong or empty password gave the Incorrect password message. Protect PDF sets a random owner password that nobody is shown, so only the open password works.
Does the decrypted copy keep the title and the XMP metadata?
In our tests, yes, for every file that decrypted, including five that stored their XMP metadata unencrypted inside an encrypted file and four whose objects were packed in compressed object streams. pikepdf read the same title from the Info dictionary and the same dc:title from the XMP packet as in the protected original opened with its password. Files from other PDF writers than pikepdf and this site's Protect PDF were not tested.
Why is the decrypted file a different size from the protected one?
The PDF library writes the whole file again without encryption, in its own layout. The test copies were 2,477 to 3,356 bytes from protected files of 2,343 to 4,530 bytes: every AES file got smaller (an AES-256 file went from 3,690 to 2,642 bytes), while the RC4 revision 2 and 3 files and the RC4 file packed in object streams grew (2,901 to 3,353 bytes for 40-bit RC4). A 56 MB scan-like file kept its page images byte for byte.
Why does it say Something went wrong instead of Incorrect password?
The file could not be read as a PDF. That message came for an AES-256 file cut to 70% of its length and for 4,000 random bytes named .pdf, whatever password was typed. A wrong password gives Incorrect password instead, and a PDF without encryption gives This PDF does not appear to be password protected.