DOCX Password Protection: Opening, Removing and Recovering Access
Distinguish open passwords from editing restrictions, explain legitimate removal and the hard limit when a password is lost.
How DOCX Locks Differ: Open Password vs. Editing Restriction
When a DOCX file blocks you, the obstacle falls into one of two categories that share no underlying mechanism. An open password (also called a read password or file encryption) encrypts the entire document stream. Without it, the file is a blob of ciphertext—no application can extract text, images, or structure. An editing restriction (write password) leaves all content visible but prevents modification: typing, deleting, or formatting changes are disabled, and the ribbon controls appear greyed out or a banner announces the restriction.
These two protections live in separate parts of the OOXML package. The open password governs an encryption layer defined in the EncryptionInfo stream inside the ZIP archive. Editing restrictions reside in the w:documentProtection element within word/settings.xml. A single file can carry both, but the open password takes precedence: you must decrypt the package before any application can read settings.xml to discover the editing restriction.
Identifying Which Lock Is Active
Open a copy of the file in any application that reads DOCX format. If the software presents a password dialog before displaying any content—and offers no “Read Only” or “View” fallback—the file has an open password. If the document opens fully, shows all text and images, but refuses keystrokes or style changes (and a status bar or pane indicates “Restricted Editing” or “Protection”), the file carries only an editing restriction.
For a definitive check, inspect the file’s internal structure. A DOCX file is a ZIP archive. Rename the extension from .docx to .zip and extract it. The presence of an EncryptionInfo stream (or an EncryptedPackage stream) confirms an open password. If no encryption streams exist but word/settings.xml contains a <w:documentProtection> element with an w:enforcement="1" attribute, the file has an editing restriction. These two indicators are independent and can coexist.
Removing an Open Password When You Know It
If you hold the password, removing it permanently requires re-saving the file without encryption.
- Open the document in Microsoft Word (desktop or Word for the web) or a compatible editor that implements the ECMA-376 Office Open XML encryption standard.
- Navigate to File > Info > Protect Document (the exact label may read “Encrypt with Password” depending on version).
- Clear the password field entirely or select the Remove Password option.
- Confirm the change and save the file.
Verification: Close the document and reopen it on a machine or user account that has never cached the password. No prompt should appear. You can also compare file sizes: an unencrypted DOCX is typically a few hundred bytes smaller because the encryption metadata streams are discarded.
Removing an Editing Restriction When You Know the Password
- Open the document in Word.
- Go to the Review tab and click Restrict Editing, or go to File > Info > Protect Document > Restrict Editing.
- In the Restrict Editing pane, click Stop Protection.
- Enter the write password when prompted.
- Save the document.
The application removes the w:documentProtection element from word/settings.xml on save. The content remains untouched because it was never encrypted.
When the Open Password Is Lost: The Hard Limit
No legitimate method exists to recover or bypass an open password on a modern DOCX file. The open password triggers AES-128 or AES-256 encryption of the entire document payload. The key is derived from the password using a salted key-derivation function—SHA-1 with 50,000 iterations for older compatibility mode, or SHA-512 with 100,000 iterations for the Agile encryption mode specified in MS-OFFCRYPTO. This is not a hash check that can be stripped; it is full encryption. Without the password, the plaintext is mathematically unrecoverable under current computational limits.
The only practical recourses are:
- Contact the person who set the password and ask for it.
- Restore a backup of the document from before encryption was applied.
- Attempt brute-force guessing if the password is known to be short, simple, or drawn from a limited dictionary. This succeeds only against weak passwords and requires specialized software running locally.
Do not upload an encrypted document to any online service that claims to “unlock” or “decrypt” open-password DOCX files. Such services cannot break AES encryption. They either return an error, serve a blank file, or collect your confidential data while attempting dictionary attacks on their own infrastructure. Once uploaded, you lose control over the document’s contents.
Removing an Editing Restriction Without the Password
Because an editing restriction is not encryption—the w:documentProtection element stores only a salted hash of the write password—the restriction can be removed by editing the file’s XML directly. All document content remains as plaintext inside the ZIP archive.
Manual XML Removal
- Create a backup copy of the DOCX file.
- Change the file extension from
.docxto.zip. - Extract the ZIP archive to a folder.
- Open
word/settings.xmlin a plain-text editor (Notepad, VS Code, or similar). Locate the
<w:documentProtection>element. A typical instance looks like:<w:documentProtection w:edit="readOnly" w:enforcement="1" w:cryptProviderType="rsaAES" w:cryptAlgorithmClass="hash" w:cryptAlgorithmType="typeAny" w:cryptAlgorithmSid="14" w:cryptSpinCount="100000" w:hash="..." w:salt="..."/>Delete the entire element, from the opening
<w:documentProtectionto the closing/>.- Save
settings.xml. - Re-zip the contents: select all files and folders inside the extracted folder (not the outer folder itself) and compress them into a new ZIP archive.
- Rename the new archive from
.zipto.docx.
Verification: Open the resulting file and attempt to type, delete text, or change formatting. All operations should succeed. To confirm structurally, re-extract the file and inspect word/settings.xml—the <w:documentProtection> element must be absent.
Side Effect of Format Conversion
Conversion pipelines that read DOCX and output PDF, HTML, or plain text inherently discard w:documentProtection because the target formats have no equivalent concept. If you are already converting the document for other reasons, the output will be unrestricted. This is a consequence of the conversion process, not a dedicated removal feature, so verify that the output preserves all intended content and formatting.
Combined Protections and Failure Modes
- Open password plus editing restriction: The open password blocks all access. You cannot inspect or remove the editing restriction until the file is decrypted. Solve the open password first.
- Corrupted EncryptionInfo stream: A DOCX file that was partially saved or truncated during encryption may have a malformed encryption header. No tool can decrypt a file with missing key material or an incomplete hash. The content is irrecoverable.
- Editing restriction removal does not recover the password: Deleting
<w:documentProtection>removes the restriction and discards the password hash. You cannot later restore the same restriction with the original password unless you re-enter it manually and re-save. - Conversion cannot bypass an open password: Any conversion tool—desktop or online—must decrypt the document stream before reading text. Without the open password, conversion fails with an error such as “file is encrypted” or “password required.” No output is produced.
Structural Reference
The behaviors described above derive from the Office Open XML standard. The encryption framework is specified in MS-OFFCRYPTO, and the document protection element is defined in the w:documentProtection section of the MS-DOCX specification. These are the authoritative sources for the XML structures and cryptographic algorithms involved.