Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Developer tools

Word to HTML

Paste your text from Word, Google Docs or a web page into the box. You get short, clean HTML with the headings, lists, links, tables, bold and italic kept, and a list of what was removed.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

When you paste formatted text, this box receives its HTML code, so you will see tags and styles here. The clean version appears on the right. The example is already pasted: replace it with your own.

Keep

Headings, paragraphs and lists are always kept. Nothing you paste leaves your device.

Clean HTML

204 characters79% smaller than the 979 characters you pasted

  • 4 blocks
  • 1 Word list rebuilt
  • 1 link kept
Pasted
979 characters
Clean HTML
204 characters
Blocks
4

Clean HTML code

<h1>Team notes</h1>
<p>Please read the <strong>draft</strong> and <em>reply</em> by Friday.</p>
<ul>
  <li>Budget</li>
  <li>Timeline</li>
</ul>
<p><a href="https://example.com/plan">Open the plan</a></p>

What was removed

  • 10 Style attributes (fonts, colors, sizes, spacing)
  • 4 Class attributes (such as Word's MsoNormal)
  • 8 Wrapper tags (span, font, div, o:p and similar)
  • 4 Comments and Office markup
  • 8 Non-breaking and odd spaces made normal

Preview

Team notes

Please read the draft and reply by Friday.

  • Budget
  • Timeline

Open the plan

How to use the Word to HTML Converter

  1. Copy your text in Word or Google Docs, click the box under Paste from Word, Google Docs or a web page and paste. The box fills with the HTML code of your text.
  2. Under Keep, switch Bold, italic, underline, Links, Tables and Indent the code on or off.
  3. Read Clean HTML code and check What was removed and Preview.
  4. Press Copy the HTML and paste it into your page, email template or editor.

How do I convert Word text to clean HTML?

Copy the text, paste it into the box, and copy the clean HTML that appears. When you paste formatted text, the box receives the HTML code that your program puts on the clipboard, which is full of formatting. The tool reads that code, keeps the structure and drops the rest.

The example on the page is a short Word paste of 979 characters. After cleaning, 204 characters are left, which is 79% smaller. A heading, a paragraph with bold and italic words, a two-item bullet list and one link are all still there. Every font name, color, size and Office tag is gone.

The four switches under Keep change the result at once. Turn off Bold, italic, underline for a plain structure with no emphasis. Turn off Links to keep the link text without the address. Turn off Tables to get each cell as its own paragraph, which suits a page where a table would not fit. Turn off Indent the code to get the shortest output, with no spaces or new lines between blocks.

You can also paste HTML code from any other place, or plain text. Plain text is split into paragraphs at each blank line, and any angle brackets in it are shown as text, not treated as code.

What the cleaner removed from the example paste
RemovedHow many
Style attributes (fonts, colors, sizes, spacing)10
Class attributes (such as Word's MsoNormal)4
Wrapper tags (span, font, div, o:p and similar)8
Comments and Office markup4
Non-breaking and odd spaces made normal8

What does the Word to HTML cleaner keep and what does it remove?

It keeps a short list of tags: headings h1 to h6, paragraphs, bulleted and numbered lists, links, strong and em for bold and italic, u for underline, line breaks, blockquote, tables with their rows and cells, and sub, sup, code and pre. A table cell keeps its colspan or rowspan number, nothing else.

It removes everything else. Style attributes, class names and ids go. Wrapper tags such as span, font and div are opened up, so their text stays but the wrapper does not. Comments, Office markup, scripts, style blocks, forms and embedded objects go. Images go too, because a pasted image points to a file on the other computer and would be broken on your page.

Bold and italic are rebuilt from the styles. When a program marks text with a style such as a heavy font weight instead of a bold tag, the tool turns it into strong or em. If several neighbouring pieces have the same style, they are joined, so you get one strong tag, not five.

Word list items arrive as ordinary paragraphs with a typed bullet or number in front. The tool spots them, removes the typed marker and builds a real ul or ol, with nested lists for deeper levels.

Can pasted text carry a script into my page?

No script, event attribute or unsafe link can pass through this tool. It does not hand your paste to the browser as live HTML. It reads the text with its own parser, keeps only the tags listed above and writes the output again from scratch, escaping every piece of text and every attribute value. The only attributes it can write are href on links and colspan or rowspan on cells.

A hostile example shows the effect. Pasting 118 characters that include an onclick attribute, a script block, a javascript: link and an image with an onerror attribute gives only this: <p>Hi</p> <p>link</p>. The preview below the code is built from that same safe output.

Links are kept only when they begin with http://, https:// or mailto:. A link with any other start, such as a javascript: address, loses the link and keeps its words. A text that looks like code, for example "<script>" typed in a paragraph, stays as visible text.

This protects what you copy out of the tool. If your own site takes HTML from other people, your server should still clean that input itself, because nobody can promise how a visitor sends it.

Why does the HTML from Word look so long?

Word stores the look of each run of text, so a single sentence can arrive wrapped in several spans, each with its own font, size and color. The example shows it: a short paste carried ten style attributes and four class names before cleaning. Those add weight to a page and can fight with your own stylesheet, so removing them lets your site's styles decide how the text looks. Each paragraph, heading and list item ends up on its own line in the output, which makes it easy to read and to compare with the earlier version.

If you want the look to stay, switch off nothing here and style the clean tags with your own CSS. For counting the words in the text first, use the word counter, and for turning special characters into codes, the HTML entities tool. Nothing you paste leaves your device.

Use it with

Questions

How do I convert Word to HTML?

Copy the text in Word, paste it into the box on this page and copy the clean HTML that appears. Headings, lists, links, tables, bold and italic are kept.

How do I remove the formatting when I paste from Word?

The tool removes style and class attributes, Office tags, comments and wrapper tags, and shows how many of each it removed.

Does it work with Google Docs?

Yes. Paste from Docs the same way. Styles that mean bold, italic or underline are turned into strong, em and u tags.

Are images kept?

No. A pasted image points to a file on another computer, so it would be broken on your page. Add images to your page yourself.

Is the output safe to use on a website?

It contains no scripts, event attributes or unsafe links. Your server should still clean any HTML that visitors send you.

Is my text sent anywhere?

No. The cleaning runs in your browser and nothing is uploaded.

The tool's results are computed in your browser by the code on this page; the explanations are checked against the tool's own output.