Toolora

HTML Formatter

Format or minify HTML with configurable indentation.

The HTML Formatter pretty-prints or minifies HTML while preserving pre, textarea, script and style content. Indentation can be set to 2 or 4 spaces or tabs.
Mode

How to use

  1. Paste HTML into the input field.
  2. Choose Format or Minify and select an indent size.
  3. Review and copy the cleaned HTML output.

Frequently asked questions

Will script and style content be changed?

No. Script, style, pre and textarea contents are preserved as-is.

Does this tool support malformed HTML?

The parser is lenient and normalizes most common malformed markup.

Is minification safe for inline text?

Inter-tag whitespace is removed while text inside elements is kept intact.