HTML formatter

Beautify messy or minified HTML into clean, indented code.

  • Development
  • 100% free & unlimited
  • No sign-up
  • Runs in your browser
HTML formatter

What is the html formatter?

The HTML formatter turns minified or badly indented HTML into clean, readable code. Choose the indentation and the line width; the CSS and JavaScript inside style and script tags are formatted too.

It's built on js-beautify, the formatter used by many code editors, and runs in your browser with a full code editor.

How to use the html formatter

  1. 1Paste HTML into the editor.
  2. 2Choose the indentation and line wrapping.
  3. 3Press Format and copy the result.

Features

Clean indentation

2 or 4 spaces or tabs.

Inline code

Formats embedded CSS and JavaScript.

Line wrapping

Optional at 80 or 120 characters.

Code editor

Syntax highlighting for input and output.

Frequently asked questions

Does formatting change how the page looks?

No, only whitespace between tags changes; the content stays the same.

What about <pre> and <textarea>?

Their content is kept exactly as it is.

How do I minify it again?

Use the HTML minifier.