HTML formatter and minifier

Format, minify, check parsing and escape HTML while retaining text, scripts, styles and attribute spelling.

HTML input

Local processing: up to 100000 UTF-16 input units, 64 tree levels and 10000 nodes; output up to 1000000 units.

Characters: 0

Instructions

Format
Arrange explicitly closed block containers with two spaces. Text, inline content, whitespace-sensitive elements and subtrees with omitted end tags stay verbatim.
Minify
Remove eligible structural newline indentation while keeping comments, attributes, entities, scripts and styles intact.
Check parsing
Check fragment or document parsing and list issues with positions. This checks parser errors rather than accessibility or every element and attribute conformance rule; no script runs.
Escape
Convert &, <, >, double quotes and single quotes to entities so source can be displayed as text.

HTML formatter and minifier

Format, minify, check parsing and escape HTML while retaining text, scripts, styles and attribute spelling.

Usage guide