loot.tools

HTML Formatter

Paste unformatted HTML and get cleanly indented output. Choose 2 or 4 space indentation. Everything runs in your browser.

Paste HTML to format it with clean indentation.

Input HTML
Formatted HTML

What this tool does

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.

When you'd use this

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.

How it works

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.

© 2026 loot.toolsYour data stays in your browser.