On a phone? Word for iPhone and Android can’t run add-ins. GenText also works in your browser: rephrase, summarize or draft text. Free plan.

Use GenText in your browser →

On a computer or iPad? Add GenText to Word →

Steps below. GenText also works in this same Word window: rephrase or summarize the text you select, draft from a heading, or find research papers to cite. Free plan.

Add GenText to Word →

Tired of Word's quirks? Try GenText in your browser →

Fix: Word Document Showing Raw XML Code

By GenText Team April 2, 2026 file-issues
Share

Quick Answer

If you see codes in curly braces like { PAGE }, Word is showing field codes: press Alt+F9 to switch back to results. If the whole file appears as tags such as <w:document>, it is opening in a browser or text editor, or it was saved as Word XML: open it from Word with File > Open, set Word as the default app for .docx in Windows Settings > Apps > Default apps, and save a copy as a Word Document (.docx).

Fixed it? GenText adds AI writing to this Word window: rephrase, summarize, draft and find papers to cite. Free plan →

Use GenText in your browser →
On a computer or iPad? Add GenText to Word →

Word Document Showing Raw XML Code

“Raw XML” can mean a few different things, and the fix depends on which one you see:

What you seeWhat it isQuick fix
Codes in curly braces, e.g. { PAGE }, { TOC \o "1-3" }Word field codesPress Alt+F9
The whole file as tags, e.g. <w:document>, <w:p>The file is opening outside Word, or it is a Word XML fileOpen it from Word and save as .docx
Strange symbols and broken text inside WordA damaged fileOpen and Repair

Fix 1: Word is showing field codes

Page numbers, tables of contents, dates and cross-references are all fields. If Word is set to show codes, you see the instructions instead of the results.

  1. Press Alt+F9 to switch all fields between codes and results.
  2. To toggle a single field, click inside it and press Shift+F9.
  3. If the codes come back every time you open the file, check the field-code display option under File > Options > Advanced, in the Show document content section, and clear it.

Fix 2: the file opens as XML tags in a browser or text editor

A Word file can be saved as Word XML Document (.xml) or the older Word 2003 XML Document (.xml). Windows usually opens .xml files in a browser or text editor, which shows the raw markup.

  1. Open Word first, then use File > Open and select the file. Word reads Word XML documents and shows them formatted.
  2. Go to File > Save As and choose Word Document (*.docx) as the file type. Send the .docx version from now on.
  3. If a .docx file opens in the wrong app, open Settings > Apps > Default apps, search for .docx, and choose Word.

If you received the file by email and it shows tags in your browser, download it and open it from Word instead of previewing it.

Fix 3: the document is damaged

  1. In Word, go to File > Open > Browse and select the file.
  2. Select the arrow on the Open button and choose Open and Repair.
  3. If that fails, try opening an earlier version from OneDrive or SharePoint version history, if the file is stored there.

Don’t open .docx in Notepad

A .docx is a ZIP package of XML parts. Opening it in Notepad or renaming it will not show readable text and can corrupt it if you save. Use Word, Word for the web or another app that supports Word documents.

Further reading

On a phone? Word for iPhone and Android can’t run add-ins. GenText also works in your browser: rephrase, summarize or draft text. Free plan.

Use GenText in your browser →

On a computer or iPad? Add GenText to Word →

Steps below. GenText also works in this same Word window: rephrase or summarize the text you select, draft from a heading, or find research papers to cite. Free plan.

Add GenText to Word →

Frequently Asked Questions

Why does my Word document show { PAGE } or { TOC } instead of text?

Those are field codes, not XML. Word is set to show codes instead of results. Press Alt+F9 to toggle all fields back to their results, or click inside one field and press Shift+F9.

Why does my document open in the browser full of XML tags?

The file is probably a Word XML Document (.xml) rather than a .docx, or Windows is opening it with the wrong app. Open it from inside Word (File > Open), then use File > Save As and choose Word Document (*.docx).

Can I read a .docx file in Notepad?

No. A .docx is a compressed package of XML files, so a text editor shows unreadable characters. Always open it in Word or another app that supports Word documents.

What if Word itself shows garbled text or tags?

The file may be damaged. In Word, go to File > Open > Browse, select the file, select the arrow on the Open button and choose Open and Repair.

Writing in Word? Add GenText

Rephrase or summarize the text you select, draft a section from a heading, or find peer-reviewed papers to cite, without leaving your document. Free plan, no credit card.

Install free →

On a phone? Word for iPhone and Android can’t run add-ins. GenText also works in your browser: rephrase, summarize or draft text. Free plan.

Use GenText in your browser →

On a computer or iPad? Add GenText to Word →

Free citation reference by email

APA, MLA, Chicago, Harvard and IEEE examples in one reference.

The resource is in English, in the email body. You can save or print the email.

Your resource request does not sign you up for tips. Existing email preferences stay unchanged unless you ask to change them. Privacy.

Share
word xml display troubleshooting