Word to clean HTML
Text copied from a word processor travels with a lot of luggage: fonts, margins, styles nobody asked for. Paste it here and you get the structure back with nothing attached, meaning headings, paragraphs, lists, links and tables.
Paste the document text below
The cleanup runs in your browser. Your text is not sent anywhere.
For WordPress
Copy, then paste into the block editor: each heading, paragraph, list and table becomes a block.
Preview
HTML code
For a “Custom HTML” block, the classic editor's Text tab or a newsletter.
What the clipboard really holds
When you copy in Word, the clipboard gets several versions of your selection at once. One is plain text. Another is HTML, and that’s the one a website editor takes when you paste.
Word’s HTML describes how the page looked on your screen. A single paragraph arrives like this:
<p class="MsoNormal" style="margin-bottom:8.0pt;line-height:107%">
<span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Hello<o:p></o:p></span>
</p>On top of that come a style sheet of several hundred lines, conditional comments and tags from Office’s own vocabulary. Google Docs is shorter but no cleaner. Everything sits inside a wrapper carrying a docs-internal-guid identifier, and bold text is a span with font-weight:700. Once on a website, those inline styles win over the site’s own design, which is why every pasted article looks slightly different from the last one.
What is kept, converted and dropped
| Outcome | Elements |
|---|---|
| Kept | Paragraphs, headings, bold, italics, bulleted and numbered lists, links (http, https, mailto, tel and site-relative ones), tables with their colspan and rowspan, block quotes, superscript and subscript. |
| Converted | A span with a bold weight (bold or 600 and above) becomes <strong>, an italic one becomes <em>. Word’s fake lists, which are paragraphs marked MsoListParagraph with a typed bullet, become real nested <ul> or <ol>. A paragraph in Word’s Title style becomes a heading. Containers such as div become plain paragraphs. |
| Dropped | Every style and class attribute, style sheets, scripts, Office tags, images, form controls, frames, empty paragraphs, stacked line breaks, bold inside headings, and runs of spaces. |
Headings follow one rule. The output only uses levels 2 to 4, because on most sites the page title already holds level 1. If your document contains a Heading 1 or a Title, every heading moves down one step. Anything deeper than level 4 becomes level 4.
A non-breaking space only survives where it has a job to do: before ; : ! ? % or a currency sign, and between a digit and what follows it. All the others become ordinary spaces.
Reading the summary
After a paste, the first line names the source the tool recognized from fingerprints in the markup (Word, Google Docs, LibreOffice, or something else) and shows the size of the code before and after. A drop of 80 to 95 percent is normal for Word.
Below that you get counts of removed inline styles and classes, and of fake lists rebuilt. Two lines ask you to do something:
- Images removed. A picture pasted from Word points to a temporary file on your own computer, and one from Google Docs to an address that expires. Your visitors wouldn’t see either. Upload the image in your site’s editor and write its alternative text there.
- Paragraphs entirely in bold. A short paragraph (under 90 characters) that is bold from start to finish is usually a heading someone typed as bold text. The tool doesn’t guess the level for you. Turn it into a real heading so search engines and screen readers can see the outline.
Two ways to take the result
- Copy for the editor
- Puts the cleaned content on the clipboard as rich text. Paste it into the WordPress block editor and each heading, paragraph, list and table becomes its own block. Most visual editors handle it the same way.
- HTML code
- The source, indented and readable. Use it in a Custom HTML block, in the code view of a newsletter service, or in a template.
If the clipboard holds no HTML at all, for example text copied from a terminal or a plain-text editor, blank lines become paragraph breaks and single line breaks become <br>.
The best cleanup starts in the document. Use the built-in Heading 1 and Heading 2 styles and the list buttons, not bigger fonts and indents applied by hand. Structure typed that way survives every export.
What is lost on purpose
Colors, highlighting, alignment, indentation, font sizes and column layouts are thrown out. So are comments and text boxes. Links to bookmarks inside the Word file, such as footnote references and table-of-contents entries, lose their link and keep their text. Table borders and column widths go too, and your site decides how tables look. The optional typography setting is meant for text written in French and should stay off for other languages.
Questions people ask
Why does text pasted from Word look different on my website?
Word puts font, size, color and spacing on every paragraph as inline styles. Inline styles override your site’s style sheet, so the pasted text keeps Word’s look and ignores your theme’s.
How do I paste from Word into WordPress without the formatting?
Paste the text here first, press “Copy for the editor”, then paste into the block editor. Headings, lists, links and tables arrive as clean blocks with no inline styles.
Is “paste as plain text” (Ctrl+Shift+V) not enough?
Plain-text paste removes the styling, but it also takes every heading, list, link, table and bold word with it, and you’re left rebuilding the structure by hand. This tool removes the styling and keeps the structure.
Does it keep tables?
Yes. Rows, cells and merged cells are kept, while widths, borders and shading are removed. For data tables that need proper header cells and a caption, use the spreadsheet to HTML table tool.
Where did my images go?
They were removed because their addresses only work on your computer or for a short time. Add each image in your site’s editor, where it gets uploaded to the server and can be given alternative text.
Is my document uploaded?
No. The script reads the clipboard and rebuilds the HTML inside your browser. The text isn’t sent to our server.