tools/format/html formatter
// formatnew

html formatter

indent, minify, validate

drag & drop · up to 5 MB (Pro: 100 MB)
— paste html to start // client-only
// output appears here

// about this tool

An HTML formatter parses markup and re-serializes it with consistent indentation, making nested elements and their relationships immediately visible. It handles void elements (br, img, input), inline vs block elements, raw content blocks (script, style, pre), and HTML comments.

// when to use

  • Unminify HTML from a web page source to inspect its structure
  • Clean up HTML generated by a WYSIWYG editor or templating engine
  • Minify HTML templates for production builds
  • Review the nesting structure of a complex component or email template

// faq

Does formatting change how the page renders?
For block elements, no — whitespace between block elements is ignored by browsers. For inline elements (span, a, em), adding whitespace can introduce small gaps. The formatter preserves inline elements on the same line to avoid this.
What happens to script and style tags?
The content inside script, style, and pre tags is treated as raw text and is not re-indented, since these elements have their own formatting rules. Only the opening and closing tags are repositioned.
// history
Pro Cloud Sync — upgrade
no operations yet