HTML Formatter
Beautify and indent HTML markup.
OpenStrip inline styles, classes, event handlers and any attributes you name from a block of HTML.
Add the HTML copied from Word, Docs or an old page.
Keep or untick style, class and on* handlers.
List more names like id, data-* or width in Also remove.
Clean the markup, then copy or download the result.
Content copied from Word, Google Docs or an old site arrives wrapped in inline styles, generated class names and leftover onclick handlers. Before it goes into your CMS, you want clean tags that inherit your own stylesheet.
Three checkboxes, all on by default, remove style attributes, class attributes and inline event handlers (any attribute whose name starts with on, such as onclick or onload). The Also remove field takes extra attribute names separated by commas or spaces; end a name with * to match a prefix, so data-* removes every data attribute and aria-* every ARIA attribute. Press Run (or Sample) to clean the HTML, then copy or download the result.
The tool runs when you press Run, not as you type, so press it again after changing a checkbox. The HTML is parsed into a document and the contents of body are returned, which means a full page loses its doctype, html and head wrapper; clean fragments rather than whole files. Think twice before removing aria-* attributes, since they often carry accessibility information. Afterwards, compact the cleaned markup or lay it out with the HTML pretty printer. If you only need the words, convert the HTML to plain text instead.
Cleaning happens on a parsed copy in the page. Inline scripts in your paste are not executed, and the markup is not uploaded.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
Yes. Untick class, leave style checked, and press Run. Each checkbox works independently.
Type data-* in the Also remove field. Any attribute that begins with the text before the asterisk is removed from every element.
No. It removes attributes, not elements. Empty spans stay in place, although without their style or class they no longer affect the layout.