How the DOCX cleaner works

A .docx file is a zip archive full of XML. DocxCleaner opens that archive in your browser, edits the main document XML according to the rules below, and re-zips everything else untouched. This page documents every rule exactly, so there are no surprises in the report.

The six cleanups, defined exactly

Strip direct character formatting
For every run (a run is a stretch of text with its own formatting) inside a paragraph whose paragraph style is a named style other than the document default — Heading 1, Title, Quote, and so on — the run-level properties bold, italic, underline, strikethrough, caps, small caps, color, size, highlight and vertical alignment are removed. The paragraph style then decides how the text looks.
Runs in Normal paragraphs keep their direct formatting. Editorial rule of thumb: in a heading, per-run decoration is almost always leftover cruft from the author typing; in body text, bold and italic often carry meaning, so the cleaner leaves them alone.
The cleanup also removes the paired property runs of the same setting (for example both the Latin and complex-script size) so Word cannot fall back to a leftover half-setting.
Remove empty paragraphs
A paragraph is removed only when it contains no text at all. A paragraph that contains anything other than text is never removed: pictures, shapes, page or column breaks, line breaks, tabs, fields, bookmarks, footnote or endnote references, comments, content controls, equations, revision marks, or list numbering.
Additional guards: the last paragraph of the document body or of a table cell is never removed, and paragraphs inside content controls or tracked deletions are skipped. Skipped empty paragraphs are counted in the report so you know why they stayed.
Normalize paragraph styles
Paragraph style references that only exist as variants of Normal — “Normal (Web)”, “NormalIndent”, “Normal2” and similar — are pointed back to the document’s real default paragraph style. References to styles that are not defined anywhere in the file are dropped, and the paragraph falls back to the default style.
Exception: if the missing reference is a standard Word built-in style ID (Heading 1, TOC 1, Body Text 2, and friends), the reference is kept. Word treats built-ins as valid latent styles, so dropping them would lose real heading structure. This guard means “Heading 1” survives even in documents whose styles.xml never defined it.
Unify fonts to the document default
Explicit font names on runs (the “ASCII”, “High ANSI”, “East Asian” and “complex script” font overrides) are removed so the text inherits the document default or theme font again. An empty font block left behind is removed as well.
Theme font references are untouched — if a run is set to “theme minor font”, that reference stays. The cleaner never edits styles.xml, so fonts configured in styles and in the theme keep working exactly as before.
Remove manual line breaks
Line breaks inside a paragraph — the ones made with Shift+Enter, called text-wrapping breaks — are removed, since editors usually want the text to wrap naturally and paragraph spacing to do the work. Page breaks and column breaks are never touched; the report counts how many were kept.
Normalize spacing
Per-paragraph spacing overrides (space before, space after, line spacing) are removed from paragraph properties so spacing comes from the styles and the document theme again. Indentation, tabs, alignment and everything else in paragraph properties are left exactly as they are.

What it will never touch

  • Text content — not a single character is edited, moved or re-ordered. The tool verifies this before offering a download.
  • Headers, footers, footnotes and endnotes — these live in separate files inside the .docx and are copied through byte-for-byte without any cleanup.
  • Tables, images, shapes and text boxes — structures are preserved exactly; only run-level properties inside body paragraphs are cleaned.
  • Hyperlinks — link targets and relationships are untouched, and link text keeps its content.
  • Tracked changes, comments and revision marks — the cleaner does not accept or reject revisions; they are left in place.
  • Macros and other embedded files — copied through untouched (the report notes when a document is macro-enabled).
  • Styles themselves — styles.xml is read to make decisions but never rewritten.

The safety systems behind the download

Character-for-character text verification
After cleaning, the tool re-reads the cleaned document and compares every paragraph of text against the original. If one character differs, the cleaned file is discarded and your original is returned instead.
Part-by-part integrity
Every file inside the archive other than word/document.xml is copied byte-for-byte, and the finished archive is re-opened and re-validated before it is offered.
Fail-safe on anything unexpected
If a document’s XML cannot be parsed, or any internal check fails, you get your original file back unchanged, with a note in the report explaining what happened. The tool never produces a possibly-corrupt file.

Understanding the report

The report lists one line per category with the number of edits: runs stripped of direct formatting, empty paragraphs removed (and kept), style references fixed, breaks removed, font overrides removed and spacing overrides removed. Anything skipped for safety appears under “kept on purpose” or in the notes section. You can download the report as a.txt file next to the cleaned document, which is handy for tracked work.

One more thing worth knowing: when a document needs no changes at all, the tool says so and hands you back the identical original file — byte-for-byte.

Next steps