HTML Formatter / Beautifier
Format messy HTML into readable indented output, or minify formatted HTML for production. Configurable indent size and attribute-wrapping rules. Useful for inspecting minified pages, cleaning up emitted HTML, or preparing snippets for documentation.
How to use the HTML Formatter / Beautifier
Paste any HTML — full document or fragment. Format produces indented output with self-closing tags handled correctly. Minify removes unnecessary whitespace while preserving spaces inside <pre> and <textarea> where whitespace is significant.
When to format vs minify
Format for reading: code review, debugging an unexpected layout, or pasting into documentation. Minify for production: trimming bytes from HTML payloads, removing the gap between what your CMS emits and what browsers actually need.
Modern build pipelines minify HTML automatically (Vite, Next.js, Astro all do it by default), so this tool is mostly useful for ad-hoc work — a snippet you got from a CMS export, an HTML fragment from an LLM, the source of a page you're reverse-engineering.