How to Fix ‘The File Format and Extension Don’t Match’ in Word

Attempting to open an emailed document, web download, or scanned export in Microsoft Word only to be halted by a security dialogue stating: ‘The file format and extension of [filename.docx] don’t match. The file could be corrupted or unsafe. Unless you trust its source, don’t open it. Do you want to open it anyway?’ creates concern about document integrity and potential malware. Clicking ‘Yes’ often results in an unreadable stream of scrambled symbols or an outright failure to open. This warning is an intentional security safeguard enforced by Microsoft Office when a file’s binary signature (magic bytes) does not match its declared filename extension.

Why Does Microsoft Word Warn of Mismatched Extensions?

Modern Word documents (.docx) are packaged OpenXML containers. The extension mismatch warning is triggered by:

  • Legacy Formats Saved with Modern Extensions: A legacy Word 97-2003 binary file (.doc), Rich Text Format file (.rtf), or HTML webpage renamed with a .docx extension.
  • Web Application and Reporting Tool Exports: Automated billing systems, CRM platforms, or survey portals exporting raw HTML or CSV tables but tagging the filename with .docx to force opening in Word.
  • Corrupted File Archive Headers: Incomplete downloads where the initial ZIP archive magic bytes (PK\x03\x04) have been truncated or corrupted.
  • Strict Office Trust Center Settings: Enterprise security baselines enforcing binary signature validation on files originating from the internet or email attachments.
  • File Renaming Mistakes: Users manually typing an incorrect extension when saving documents in third-party editors like LibreOffice or Google Docs.

Step 1: Check the True File Format via a Text Editor

Examining the initial header bytes of the file in a plain text editor reveals the genuine file format immediately.

  1. Right-click the problematic file and select Open with > Notepad (or any text editor like Visual Studio Code).
  2. Inspect the very first line of characters in the file:
    • If it begins with PK (e.g., PK...), it is a genuine modern OpenXML .docx ZIP container.
    • If it begins with {\rtf1, it is actually a Rich Text Format (.rtf) document.
    • If it begins with <!DOCTYPE html> or <html>, it is a web page (.html).
    • If it begins with non-printable characters like ÐÏࡱá, it is a legacy Word 97-2003 (.doc) binary file.
  3. Close Notepad without saving any changes.

Step 2: Rename the File Extension to Match Its True Format

Once you identify the actual file structure, correcting the extension eliminates the Office security warning completely.

  1. Open File Explorer in Windows 11.
  2. Click the View menu on the top toolbar, hover over Show, and ensure File name extensions is checked.
  3. Right-click your file and select the Rename icon (or press F2).
  4. Change the extension to reflect the header identified in Step 1:
    • Change to .rtf if it was Rich Text.
    • Change to .html if it was a web table.
    • Change to .doc if it was a legacy Word 97-2003 binary file.
  5. Press Enter and click Yes on the confirmation prompt.
  6. Double-click the file. Microsoft Word will now render the document smoothly without warning prompts.

Step 3: Unblock the File in Windows Properties

If the file was downloaded from the internet or attached to an email, Windows Attachment Manager attaches an NTFS Alternate Data Stream security block.

  1. Right-click the file and select Properties.
  2. Under the General tab, look at the bottom section labelled Security.
  3. If you see: ‘This file came from another computer and might be blocked to help protect this computer’, check the box labelled Unblock.
  4. Click Apply and then OK.

Step 4: Use ‘Open and Repair’ in Microsoft Word

If the file is indeed a .docx file but has corrupted internal XML headers, Word’s recovery parser can reconstruct the container.

  1. Open Microsoft Word to a blank document.
  2. Click File > Open > Browse.
  3. Select your file (click once to highlight it).
  4. Click the downward arrow next to the Open button and choose Open and Repair.
  5. Allow Word to reconstruct damaged tables and formatting. Once open, immediately save the file under a new filename via File > Save As.

Step 5: Adjust File Block Settings in Trust Center

If your organization blocks legacy or non-standard file formats from opening, check File Block settings.

  1. In Word, go to File > Options > Trust Center.
  2. Click Trust Center Settings and select File Block Settings from the left pane.
  3. Ensure that older file formats (such as Word 97-2003 Documents and Templates) are not checked under the Open column.
  4. Click OK and reload your document.

Identifying true file header formats and correcting file extensions ensures that Microsoft Word opens all incoming documents safely and accurately.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.