How to Use
- Choose a mode
Select Beautify or Minify from the toolbar.
- Enter HTML
Paste or type HTML code into the input area and click "Convert".
- Copy result
Use the "Copy" button to copy the formatted HTML to your clipboard.
HTML Formatter Examples
HTML Beautify
Input
<div><h1>Title</h1><p>Text</p></div>Output
<div>
<h1>Title</h1>
<p>Text</p>
</div>Block elements are placed on separate lines with proper indentation.
HTML Minify
Input
<div>
<h1>Title</h1>
<p>Text</p>
</div>Output
<div><h1>Title</h1><p>Text</p></div>All unnecessary whitespace and newlines are removed.
Features
- HTML beautify with block-level indentation
- HTML minify to remove unnecessary whitespace
- Configurable indent size (2 or 4 spaces)
- Self-closing tag recognition (<br/>, <img/>, etc.)
- Proper inline vs block element handling
- Real-time preview support
- Local processing for privacy
FAQ
Which HTML tags are supported?
Major block elements including div, p, section, article, header, footer, nav, main, ul, ol, li, table, tr, td, th, thead, tbody, form, head, body, and html.
Can it format HTML that contains JavaScript or CSS?
Script and style tags are recognized, but the code inside them is not reformatted. Use dedicated JS/CSS formatters for that.
Is my data sent to a server?
No. All processing happens locally in your browser and nothing is uploaded.