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.
- Paste the HTML into the box.
- Run the tool; the code is expanded with indentation.
- 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.