uuutil ← all tools

HTML formatter

Paste HTML (up to 5 MB) and read it beautified: one block element per line, indented 2, 4 or a tab per level, text and inline tags flowing together with an optional wrap column, and blank lines kept or collapsed as you choose. Or flip to minify: comments drop — except conditional comments and license banners — and whitespace between tags collapses, with the size saving shown. Either way the content of pre, textarea, script and style comes out byte-identical, never reflowed (the classic formatter breakage), and nothing but whitespace and comments is ever touched. The markup is walked by a tolerant local tokenizer, never parsed into the live page (no innerHTML), so pasted scripts and event handlers can never run.

Privacy ledger

Data acquired None.
Libraries used Lit 3 — bundled into the tool file itself.
Data stored None.
Data transmitted None.

Use it on your own page

Download the tool as a single self-contained HTML file: readable source with the Lit library included, zero network requests — it works opened straight from your disk, and you can customize everything.

Prefer the hosted widget? One script tag embeds it and stays up to date:

<script type="module" src="https://uuutil.com/tools/html-formatter.js"></script>
<uu-html-formatter lang="en"></uu-html-formatter>

Source license: MIT — free to use, modify and redistribute; keep the license notice in copies.