HTML Formatter & Beautifier
Paste raw or messy HTML on the left and get a properly indented version on the right.
Features
How to Use
1. Paste your HTML markup into the input box on the left.
2. Click Format to beautify it with proper indentation.
3. Click Minify to remove whitespace.
4. Copy or download the result on the right.
About this tool
HTML copied from a browser, a CMS or a minified build often arrives as one unreadable line. This formatter re-indents it so each nested element sits one level deeper than its parent, making structure, missing closing tags and misplaced elements easy to spot. It understands void elements such as <br>, <img> and <input> that never have closing tags, and it leaves the contents of <pre>, <textarea>, <script> and <style> exactly as they are, because whitespace inside them is meaningful. Choose two spaces, four spaces or tabs, then copy or download the result. Minify does the reverse, removing comments and collapsing whitespace between tags to reduce page weight for production.