HTML Formatter | How to use and interpret results
Split HTML at tag boundaries and indent it with two spaces per level. Void elements such as br and img are recognized, but the formatter is not a semantics-preserving document parser.
- Runs in your browser
- Nothing is uploaded
- No signup; device limits apply
Loading the tool. If it does not appear, reload this page.
How to use this tool
Paste markup and inspect the resulting nesting. Keep the original for comparison around pre or script content where spaces and angle brackets can be data.
Results and examples
<section><br><p>Text</p></section> becomes separate readable lines inside section. Neat indentation is not a validation result for missing tags or invalid attributes.
Worked example
<section><br><p>Text</p></section> becomes separate readable lines inside section. Neat indentation is not a validation result for missing tags or invalid attributes.
Limitations
- A > inside an attribute or script syntax can conflict with simple token splitting.
- Whitespace cleanup may change visible spacing or text.
Fields
| Field | Guidance and constraints |
|---|---|
| HTML | Check the unit and format displayed beside this field. |
| Result | Check the unit and format displayed beside this field. |
Data handling
Processing stays in the current browser tab; the site does not upload tool input for the calculation itself.
Sources
Frequently asked questions
How is indentation handled after br?
Text becomes separate readable lines inside section. Neat indentation is not a validation result for missing tags or invalid attributes.
Can I overwrite the original without review?
A > inside an attribute or script syntax can conflict with simple token splitting. Whitespace cleanup may change visible spacing or text.