HTML Cleaner

Strips the junk office editors leave behind: Word service tags, inline styles, classes, empty tags and non-breaking spaces.

A preset turns on the checkboxes below. You can flip any of them by hand.

Your code stays in the browser: nothing goes to the server.

Text copied from Word or Google Docs brings its service markup with it: tags like <o:p>, MsoNormal classes, inline styles on every paragraph, conditional comments. None of this improves the layout, while the page weight grows three to four times.

Lists are a separate problem. Word does not output them as lists but as a chain of paragraphs, and it puts the bullet character right into the text. On a site, such a list loses both indentation and numbering, and a dot stays hanging before each item.

What gets removed

  • Word service markup: tags with a colon, o: and v: attributes, conditional comments, bullet characters;
  • inline styles, classes, identifiers, data attributes;
  • empty tags, including those containing only a non-breaking space;
  • obsolete tags: <font>, <center>, <strike> along with presentational attributes like align and bgcolor;
  • links, images, and tables when you only need the text.

Paragraph items left over from Word are assembled back into <ul> or <ol>; the list type is determined by the bullet character.

Tags <script>, onclick handlers, and javascript: links are removed regardless of the checkboxes. People usually clean someone else's code before putting it on their own site, and the active part of it is not needed there.

Rate this tool

Help us get better

Other tools