Skip to content
Test versionSearch

Text and writing

HTML formatter

Indent or compact whitespace between block tags in HTML source, keeping mixed content and code blocks intact. Download the source and reports.

How it worksFAQRelated tools

Content reviewed:

Also available for Germany, in German 

Explicit matching end tags and quoted attribute values; boolean attributes allowed. Up to 20,000 UTF-16 code units, 1,024 counted elements, 32 levels and 64 attributes per tag. No optional end tags, unquoted values or SVG/MathML.

No HTML conformance, sanitization or visual layout validation. Comments, attributes and mixed subtrees stay unchanged; script/style/textarea/title/pre are preserved source spans. Inner tags in those spans are not counted. Source file is TXT; the HTML report displays only escaped code.

Decimal results are approximate. Inputs stay in this browser tab.

Sources

How it works

No HTML conformance, sanitization or visual layout validation. Comments, attributes and mixed subtrees stay unchanged; script/style/textarea/title/pre are preserved source spans. Inner tags in those spans are not counted. Source file is TXT; the HTML report displays only escaped code.

Worked example

Two paragraphs inside a section gain layout breaks; mixed inline words remain unchanged.

Frequently asked questions

How do I format HTML with indentation?

Paste your source and choose to indent or compact whitespace between supported block tags. For example, two paragraphs inside a section gain layout breaks.

What HTML does the formatter accept?

Explicit matching end tags and quoted attribute values, with boolean attributes allowed. No optional end tags, unquoted values, SVG or MathML.

What are the size limits of the HTML formatter?

Up to 20,000 UTF-16 code units, 1,024 counted elements, 32 levels and 64 attributes per tag.

What does the formatter leave unchanged?

Comments, attributes and mixed inline content stay unchanged. Script, style, textarea, title and pre are preserved source spans.

Does the formatter validate or sanitise HTML?

No. There is no HTML conformance, sanitization or visual layout validation.

What can I download?

Result JSON, formatted source TXT, a printable code report and statistics as TXT or CSV.