HTML Formatter
Paste HTML to format it with clean indentation.
Paste HTML to format it with clean indentation.
Paste any HTML and it gets reformatted with consistent indentation and line breaks. Nested elements are indented so you can see the document structure at a glance. It handles self-closing tags, attributes, inline styles, and script blocks correctly.
You've copied HTML from a website's view-source and it's all on one line. Or you're debugging a template and need to see the nesting. Or you've minified your markup for production and need to read it again. Paste it here instead of manually adding line breaks.
The formatter parses your HTML and rebuilds it with proper indentation. It preserves your content and attributes while adding line breaks between elements. Pick 2 or 4 spaces depending on your preference, copy the result, and paste it back into your editor.