HTML Formatter & Minifier
Clean up HTML indentation or compress it by removing unnecessary whitespace.
How the HTML formatter works
Paste your HTML
Add a full page or an HTML snippet into the input box.
Format or minify
Format places each tag on its own line for readability. Minify strips comments and collapses whitespace between tags for a smaller file.
Copy the output
Copy the formatted or minified markup for use in your project.
Frequently asked questions
Is this a full HTML parser?
No. It's a lightweight formatter that adjusts whitespace between tags rather than fully parsing the document, so it works best on reasonably well-formed markup.
Will minifying break my page?
Minifying only removes comments and collapses whitespace between tags; it does not touch the content or attributes inside tags, so page behavior stays the same.
Is my HTML uploaded anywhere?
No. Formatting and minifying run locally in your browser.