How to use HTML Formatter
Use consistent indentation and whitespace in HTML documents and fragments for easier review and maintenance.
- Paste HTML markup into the source editor.
- Select Format code.
- Review the normalized markup and copy it.
Example
Input
<main><h1>Hello</h1></main>
Result
<main>\n <h1>Hello</h1>\n</main>
Important to know
The formatter follows HTML syntax and may normalize whitespace or quote styles. Check rendered output when whitespace-sensitive markup is involved.