HTML

HTML Formatter

Turn minified or messy HTML into clean, properly indented markup — instantly, in your browser.

Formatting runs locally in your browser. Nothing is uploaded, logged, or stored.

0 chars
1
Paste messy HTML here...
0 chars
Result appears here

How to use

  1. Paste your HTML — a full document or just a fragment.
  2. Click Format — tags are re-nested and indented with two spaces per level.
  3. Copy the prettified markup or download it as an .html file.

How does it format?

The markup is parsed with the browser's native HTML parser and re-serialized with consistent indentation, so unclosed tags are normalized and nesting becomes visually obvious. Void elements like <img> and <br> are handled correctly, and fragments are formatted without being wrapped in a full document skeleton.

Going the other way? Compress markup again with the HTML Minifier or check the structure with the HTML Validator.

Examples

Debug generated templates

Server-rendered or bundled HTML often arrives as one giant line — format it to read the structure.

Clean up pasted snippets

Normalize indentation of copied code blocks before publishing them in docs or reviews.

Frequently Asked Questions

Is my HTML uploaded anywhere?+
No. Parsing and formatting happen entirely in your browser.
Can it format partial HTML?+
Yes — fragments are formatted as-is without injecting html/head/body wrappers.
Does formatting change how the page renders?+
No visible change is intended; only whitespace and indentation are adjusted. The parser may normalize genuinely broken nesting, which is usually a fix you want.
What indentation is used?+
Two spaces per nesting level — easy to read and diff-friendly.

Related Tools

Looking for something else? Browse all tools