HTML formatter and minifier
Paste raw or minified HTML and get back cleanly indented markup — or collapse a
formatted document back to a single line. Indentation follows tag nesting depth,
and the formatter recognises HTML void elements (img, br, input, meta,
link, hr and friends) so they never wrongly indent the lines that follow. The
contents of pre, script, style and textarea are preserved verbatim because
their whitespace is significant.
It is privacy-first: the formatter is plain JavaScript that runs in your browser, so your markup never leaves your device. Only inter-tag whitespace changes — attributes, text and raw element contents are kept exactly.