HTML Formatter
Prettify and format HTML with proper indentation. Supports 2-space, 4-space, or tab indentation and attribute wrapping.
Indent:
How to Use
Prettify and format HTML with proper indentation. Supports 2-space, 4-space, or tab indentation and attribute wrapping.
- 1Paste your minified or unformatted HTML into the input area on the left.
- 2Choose your preferred indent size — 2 spaces, 4 spaces, or tabs.
- 3Toggle 'Wrap attributes' if you want each HTML attribute on its own line (useful for long tags).
- 4Click 'Format' to generate the prettified HTML output on the right.
- 5Click 'Copy' to copy the formatted HTML to your clipboard.
Key Features
- Smart indentation — correctly handles void elements, inline elements, and self-closing tags
- Wrap attributes mode — puts each attribute on its own line for long or complex tags
- Three indent styles — 2 spaces, 4 spaces, or tabs to match your project's coding style
- Fragment support — formats HTML snippets without wrapping them in an html/body document
- 100% client-side — nothing is uploaded; paste, format, and copy without leaving your browser