HTML Formatter & Minifier
Beautify HTML with Prettier, or minify it for production. This tool beautifies and minifies HTML on one page — paste your code, pick a mode, and click. Everything runs on your device, nothing is sent to a server.
Everything runs in your browser. Your code is never sent to our servers.
Example
Example Input
<ul><li>One</li><li>Two</li></ul>
Example Output
<ul> <li>One</li> <li>Two</li> </ul>
How to Use
- 1Choose Format or Minify mode at the top.
- 2Paste your HTML code into the Input field.
- 3If needed, set the indent width in "More settings".
- 4Click the button (or press Ctrl+Enter) to process. The result appears in the Output field.
- 5Click Copy to copy the result.
About the HTML Formatter
The HTML Formatter beautifies HTML markup using Prettier (the industry standard) so elements are cleanly and consistently indented, or minifies it by removing whitespace and comments.
How it works: for Format, Prettier parses the HTML (including inline CSS/JS) and rewrites it in a consistent style. For Minify, the tool strips comments and whitespace between tags.
Clean HTML is easier to maintain and review, while minified HTML speeds up page loads in production by reducing file size.
FAQ
Can this HTML tool both format and minify?
Yes. One page with a toggle — Format mode prettifies (beautifies) with indentation, and Minify mode compacts it. No need for two separate pages.
Is my code sent to a server?
No. HTML is processed entirely in your browser using JavaScript/WebAssembly. Your code never leaves your device.