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
Please enter some input.
How to use
- Paste HTML into the input field.
- Choose Format or Minify and select an indent size.
- 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.
Related tools
JSON Formatter
Format, validate and minify JSON in one place.
XML Formatter
Pretty-print and indent XML documents.
YAML Formatter
Format YAML and convert between YAML and JSON in both directions.
CSV to JSON
Convert CSV tables into JSON data.
JWT Decoder
Decode JWT header, payload and expiration.
Hash Generator
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes.