HTML Beautifier

Expand compressed HTML into indented, readable markup. The work happens entirely in your browser.

The output will appear here.

How HTML Beautifier works

Expand compressed HTML into indented, readable markup. The work happens entirely in your browser.

Input HTML
Output Readable HTML
Works done 2,507

Related tools

HTML Beautifier Details

HTML Beautifier expands markup that has been squeezed onto one line into an indented, readable shape.

Use it to inspect a minified template, make email HTML editable, or clean up a fragment copied from a page.

Step by step

Short version: give it input, run it, take the output. Details below.

  1. Paste the HTML into the box.
  2. Run the tool; the code is expanded with indentation.
  3. Copy or download the result.

Limits and processing behaviour

Formatting behaviour:

  • A simple brace and semicolon based expansion is applied, using two-space indentation.
  • Runs of blank lines collapse into one.
  • Everything happens in your browser; the code is never uploaded.
  • The line under the output panel reports characters, lines and bytes.

Is this the right tool

This page makes code readable. To go the other way and shrink the file, use the HTML Minifier.

This is a text-level formatter, not an HTML parser: it does not validate nesting, will not find a missing closing tag, and leaves attribute order untouched. Code inside inline script and style blocks is left as it is.

Practical notes

  • Open the formatted markup in a browser before shipping it.
  • With template engines that emit very long lines, format the template first and the output second.
  • Use the same formatting for files under version control to keep diffs quiet.

Data and privacy

This tool runs entirely in your browser, so what you type is not sent to the server. The only request that leaves is a counter with no content in it. Third-party advertising cookies may be present on the page, and they cannot read your input.

Frequently asked questions

Type or paste your data into the HTML field, run the tool, then copy or download the Readable HTML result.

Yes. While the text field is focused, Ctrl + Enter (Cmd + Enter on macOS) runs the tool.

You can copy the output or save it as a text file with the download button. The file name is based on the tool name.

The tool shows the error message in the output area. Fix the input and run it again.