HTML Formatter
Paste HTML to pretty-print it with consistent indentation for readability, or compress it into a minified single line. This is a pure text reformatter — the input is never parsed into a live DOM or executed.
Developer Tools Runs entirely in your browser
The code is processed entirely on your device and is never sent to any server. This tool only reformats text — it never executes any HTML code.
Result
—
What this tool does
Reformats HTML with indentation that shows how elements nest, or minifies it to the smallest size.
When to use it
- Generated HTML that came out with no formatting.
- Inspecting the structure of a page you copied from somewhere.
- Preparing markup to display in an article or a review.
- Minifying HTML before publishing to reduce its size.
How to use it
- Paste the HTML into the field.
- Click format or minify.
- Copy the result.
A practical example
Input
A generated HTML page on one long line.
Output
The same markup with each element on its own line, indented to match its depth.
Limitations
- This formats and does not fix: unclosed elements and broken structure are left as they are.
- Whitespace in HTML is sometimes significant — particularly inside text elements — so formatting can change rendering in rare cases.
- Minifying strips whitespace and line breaks, so markup relying on a space between two inline elements may look different.
Privacy and processing
The markup is processed entirely on your device and is never sent to any server.
Technical notes
- Formatting operates on the text and never renders or executes the markup, so pasting a page containing a script carries no risk.