HTML Cleaner

Paste messy HTML into the code panel on the right and press "Clean All", or use the nine buttons above the code to remove one kind of clutter at a time.

Undo
Redo
Bold
Italic
Underline
Strikethrough
Heading 1
Heading 2
Heading 3
Paragraph
Text Color
Highlight / Background
Align Left
Align Center
Align Right
Justify
Bullet List
Numbered List
Insert Link
Insert Image
Insert Table
Code Block
Blockquote
Horizontal Line
118 words630 chars

How to use it

  1. 1

    Paste the HTML

    Put the code into the HTML panel, or paste formatted text into the left panel and let the editor produce the HTML.

  2. 2

    Choose what to remove

    Press "Clean All" for everything, or pick single tools such as Remove Inline Styles or Remove Classes.

  3. 3

    Format and copy

    Use "Format HTML" to indent the code so it is easy to read, then copy or download it.

The nine cleaning tools

Remove Inline Styles deletes style attributes. Remove Empty Tags deletes elements with nothing inside. Remove Classes and Remove IDs delete those attributes. Remove Comments deletes HTML comments. Remove Extra Whitespace collapses repeated spaces. Remove Word Markup strips Office-specific tags and mso- properties. Remove Spans unwraps span tags and keeps their text. Semantic HTML turns <b> and <i> into <strong> and <em>.

What stays untouched

Cleaning removes presentation, not content. Text, links and their addresses, images, lists and table structure all stay, and empty table cells are kept so tables do not shift.

When not to remove inline styles

HTML email is the main exception. Email programs ignore most stylesheets, so a newsletter needs its inline styles. For email, use Remove Word Markup, Remove Comments and Remove Empty Tags and leave the styles alone.

Questions

Can I undo a cleaning step?

Yes. Press Ctrl+Z or use Edit > Undo to go back to the code as it was before the last change.

Does it work on HTML that did not come from Word?

Yes. It works on any HTML: code copied from a website, exported from Google Docs, or produced by another editor.

Is my code sent to a server?

No. All cleaning is done in your browser.

More tools