Remove Hidden Data from Word Documents
Operator: Abdulla Al Fahad. How tools are built and checked
A Word file carries more than the words on the page. The document properties record who created it and who saved it last, sometimes the company name from the licence, and whatever was typed into the title, keywords and comments boxes years ago in the template it came from. Margin comments and tracked changes keep each reviewer's name and the wording they proposed. Send that file to the other side of a negotiation and they can read all of it.
This page opens the .docx, shows you what it holds in a table, and lets you tick what to take out. The clean copy is saved as <name>-clean.docx, and the table then shows each item before and after, so you can see that the reviewer's name is gone rather than hope it is. The words of the document are not changed unless you tick Accept all tracked changes or Remove hidden text.
Key features
- A table of every property, comment author, tracked-change author and hidden run the file contains
- Eight separate options, so you can strip names but keep comments, or the reverse
- Before and after columns built by scanning the clean copy, not by assuming the edit worked
- Comments removed together with their anchors in the text, their extended parts and the people list
- Custom properties removed along with their relationship and content-type entries
- Accept all tracked changes, off by default and flagged with a warning because it changes the text
- Parts that did not need editing are copied across as they were
Which parts are scanned and which rewritten
Input is one .docx of up to 25 MB. The file must start with the ZIP signature and contain word/document.xml. An older binary .doc, a password-protected Word file (which is not a ZIP at all), an .xlsx or .pptx, or a renamed archive is refused with a message saying which of these it looks like. Any XML part that would unpack to more than 150 MB is treated as damaged or hostile and stops the run.
The scan reads docProps/core.xml (author, last modified by, title, subject, keywords, description, created and modified dates, revision number), docProps/app.xml (company, manager, template), docProps/custom.xml (custom property names), word/comments.xml (how many comments and by whom), and word/document.xml for tracked insertions (w:ins), tracked deletions (w:del), moves and formatting changes, runs formatted as hidden (w:vanish) and revision-ID attributes (w:rsid…). The w:rsids list in word/settings.xml is counted too.
Output is a .docx built from your file with JSZip. Only the XML parts touched by the options you chose are rewritten, and within those parts only the matching elements are cut out; everything else, including images, styles and layout, is copied across unchanged. The page lists which parts were rewritten or removed.
How it works
A .docx is a ZIP archive of XML files. The page unzips it in memory with JSZip and reads the handful of parts that hold hidden data. Each part is scanned with a small tag reader that tracks nesting, so a run inside a text box inside another run is matched to its own closing tag rather than the first one that comes along.
Each option maps to specific elements. Removing names deletes dc:creator and cp:lastModifiedBy from core.xml. The title group deletes dc:title, dc:subject, cp:keywords and dc:description. Company and manager are deleted from app.xml. Custom properties remove docProps/custom.xml and the two references to it, because Word reports an error if a listed part is missing. Comments remove word/comments.xml, commentsExtended.xml, commentsIds.xml, commentsExtensible.xml and people.xml with their references, plus the comment range markers and reference runs in the body, headers, footers and notes.
Remove revision IDs deletes every w:rsid attribute from the body, settings, styles, numbering, headers, footers and notes, and the w:rsids list in settings.xml. Word uses these to tell editing sessions apart when merging copies; they are not shown anywhere. Remove hidden text deletes runs whose own formatting turns w:vanish on. Accept all tracked changes deletes w:del and w:moveFrom content, unwraps w:ins and w:moveTo so their text becomes ordinary text, and drops the stored old formatting of formatting changes.
After the edits, the new parts are scanned again with the same code that produced the first column. That second scan is what fills the After column.
Common use cases
- Sending a contract draft to the other party without the reviewer's name in the properties
- Publishing a policy document whose template still names a former employer in the Company field
- Submitting a manuscript or grant application for blind review
- Sharing a report outside the company after internal comments have been dealt with
- Checking a file received from someone else for tracked changes they may not have meant to send
How to use this tool
- Choose the .docx you are about to send.
- Read the table. Names in the Author, Comments and tracked-change rows are the ones people most often forget about.
- Tick what to remove. The four property options start ticked; comments, revision IDs, hidden text and tracked changes start unticked.
- Press Clean document and check the After column. Items you removed show none or 0.
- Download the clean copy and open it in Word to confirm it reads the way you expect before you send it.
Example
contract-draft.docx, scanned
Author: Dana Reviewer
Last modified by: Lee Editor
Company: Northfield Legal LLP
Custom properties: 1 (MatterNumber)
Comments: 3 by Sam Patel, Dana Reviewer
Tracked insertions: 1 by Dana Reviewer
Tracked deletions: 1 by Lee Editor
Revision IDs: 412 in document.xml, 27 in settings.xmlcontract-draft-clean.docx, default options
Author: none
Last modified by: none
Company: none
Custom properties: 0
Comments: 3 by Sam Patel, Dana Reviewer (option off)
Tracked insertions: 1 by Dana Reviewer (kept until Accept all is ticked)
Tracked deletions: 1 by Lee Editor (kept)
Revision IDs: 412 in document.xml, 27 in settings.xml (option off)Tips for best results
- Removing the author does not touch the names on comments and tracked changes. Those are separate rows and separate options.
- If comments contain discussion you want to keep, save a copy of the original first; removal deletes the comment text with the comment.
- Accept tracked changes only after reading them. Accepting a deletion you did not notice removes that text for good.
- Word writes your user name into Last modified by when you save the clean copy again, so clean the file as the last step before sending.
- The Created and Modified dates, the revision number and the template name are shown for information and kept as they are.
Common pitfalls
Hidden text applied through a paragraph or character style, rather than directly on the run, is not detected or removed. Only runs whose own formatting is set to hidden are handled.
When a whole table row was deleted with tracking on, accepting removes the row's text but leaves the empty row in place. A deleted paragraph mark loses its tracking marker but the two paragraphs are not joined.
Names typed into the body, headers or footers are ordinary text and stay. So do names in embedded objects, in picture file details and in the alt text of images.
Removing comments also removes people.xml, where Word lists the people who wrote comments. Tracked-change authors are not stored there; their names sit on each w:ins and w:del element and stay unless you accept the changes.
Macro-enabled documents (.docm) and Word templates (.dotx, .dotm) are refused. Save a .docx copy first and clean that.
Common errors and how to fix them
- "This is an older binary .doc file or a password-protected Word document."
- Both start with the same header, which is not a ZIP. For a protected file, clear the password under File > Info > Protect Document in Word. For a .doc, export it in the current Word format; either way, the resulting .docx is the file to load here.
- "This ZIP has no word/document.xml, so it is not a Word document."
- The file is a ZIP, but not a Word document; it may be an Excel or PowerPoint file, or an archive renamed to .docx. Choose the actual Word file.
- The table shows tracked changes, but Word displays none.
- Word may be set to show the final version without markup. In the Review tab, switch the display to All Markup and the changes appear.
- The clean copy still shows a comment author.
- The Remove comments option was off. Tick it and press Clean document again; the After column should then show 0.
Best practices
- Keep the original file and send only the clean copy, so you can go back to the comments later.
- Run the cleaner as the very last step, after the final edit and save.
- Open the clean copy once before sending to confirm the text is the version you mean to share.
- For blind review, also check headers, footers and the title page for names typed as text.
What is not changed
Without the two text options, the body XML is edited only to remove comment markers or revision IDs when you ask for them, and both are invisible in Word. Paragraphs, formatting, images, tables, headers, footers, styles and page setup are copied from your file. The created and modified dates, revision number and template name stay as they were.
Where your document goes
This tool writes nothing to localStorage, sessionStorage or IndexedDB, and the document is read in this tab. It is unzipped and rewritten in memory, and the clean copy is handed to your browser as a download.
Frequently asked questions
Will the document look different after cleaning?
Not with the property, comment or revision-ID options; those items are not part of the visible page apart from comment balloons. The text changes only if you accept tracked changes or remove hidden text.
Does it remove the names on tracked changes without accepting them?
No. The names belong to each change, and the tool either keeps the changes with their names or accepts them, which removes both. Accept them in Word first if you want some kept and others rejected.
Can I clean a .doc file?
No. Open it in Word or LibreOffice, save it as .docx, and clean that copy.
Why do the default options leave comments and tracked changes alone?
Removing them deletes content someone wrote, and accepting changes alters the text. Those choices are left to you; the property options only remove labels stored about the file.