OpusDesk Hub Tools

HTML Formatter

Indent or compact pasted HTML markup.

Formatted HTML

What this tool does

Indent or compact pasted HTML markup. The browser HTML parser builds a document or fragment, then the formatter serializes its nodes with the selected indentation or compact spacing. The parser can repair malformed markup. Inline text spacing and preformatted/script/style content need inspection in the result.

How to use HTML Formatter

  1. Prepare the input. Paste HTML source.
  2. Run or configure the tool. Choose indentation and Format, or select Minify.
  3. Check and use the output. Compare the resulting markup and copy it only after checking significant whitespace.

How this tool works

The browser HTML parser builds a document or fragment, then the formatter serializes its nodes with the selected indentation or compact spacing. The parser can repair malformed markup. Inline text spacing and preformatted/script/style content need inspection in the result.

Worked example

Input: Minify: <div> <p>QA</p> </div>

Output: <div><p>QA</p></div>

Limits, assumptions and interpretation

This is a markup formatter, not a standards validator, sanitizer or JavaScript/CSS formatter.

  • Browser parsing may normalize tags, attributes or invalid nesting; keep the original source.
  • Test scripts, styles, templates and significant whitespace after formatting. The output is text; do not execute untrusted HTML.

Supported inputs and limits

  • Minify: <div> <p>QA</p> </div>
  • This is a markup formatter, not a standards validator, sanitizer or JavaScript/CSS formatter.
  • Browser parsing may normalize tags, attributes or invalid nesting; keep the original source.
  • Test scripts, styles, templates and significant whitespace after formatting. The output is text; do not execute untrusted HTML.

Frequently asked questions

What does this tool actually do?

The browser HTML parser builds a document or fragment, then the formatter serializes its nodes with the selected indentation or compact spacing. The parser can repair malformed markup. Inline text spacing and preformatted/script/style content need inspection in the result.

What should I check before using the result?

This is a markup formatter, not a standards validator, sanitizer or JavaScript/CSS formatter. Browser parsing may normalize tags, attributes or invalid nesting; keep the original source. Test scripts, styles, templates and significant whitespace after formatting. The output is text; do not execute untrusted HTML.

Is information sent to a server?

Tool inputs are processed in this browser. This product does not use analytics or send your input to an external API. Clicking an external website link still visits that website.

Related tools