FormatIn browser

HTML formatter

An HTML formatter/minifier for markup, email templates and page snippets: formatting, minification and useful parser errors right in the browser.

Use cases
HTML snippetsEmail templatesPage markupMinification
Input HTML
characters: 0lines: 0
Result

How it works

The HTML formatter uses the browser build of the Prettier HTML parser. Formatting normalizes indentation and line breaks, while minification first checks the markup with the parser and then compresses whitespace between tags. Everything runs locally — HTML is never sent to a server.

When to use it

Formatting helps inspect template snippets, email markup, copied HTML and components before review. Minification is useful for compactly pasting small HTML fragments into configs, tests or CMS fields.

How to use it

  1. 1Paste HTML into the editor.
  2. 2Click Format for readable indentation or Minify for compact output.
  3. 3If the parser cannot read the markup, fix the issue shown in the result area.
  4. 4Copy the result or clear the fields.

Questions

Is HTML sent to a server?

No. Formatting and minification run in your browser, so the markup stays on your device.

What happens with broken HTML?

The tool parses HTML locally. If the syntax cannot be processed, it shows a clear error instead of returning a misleading result.

Does minification change script or pre content?

No. The minifier preserves script, style, pre and textarea blocks so meaningful whitespace and code are not broken.

Other tools

All tools