HTML Minifier and Beautifier
Format messy HTML so it is easy to read, or minify it to make your pages smaller.
How to use the HTML Minifier and Beautifier
- Paste your HTMLPaste a page or snippet, or open an .html file.
- Choose Beautify or MinifyBeautify adds clean indentation. Minify removes comments and extra spaces.
- Copy the resultCheck the size change, then copy or download the result.
Example
Beautify turns <ul><li>One</li><li>Two</li></ul> into one tag per line with two-space indentation.
Minify removes comments and line breaks. The sample page shrinks by about 8%, while <pre> text keeps its exact spacing.
Frequently asked questions
Is minified HTML safe to use?
Yes. Only comments and extra whitespace are removed. Content inside <pre>, <textarea>, <script> and <style> is protected, and conditional comments for old Internet Explorer are kept.
What does “Remove all spaces between tags” do?
It also deletes the single space between inline tags such as </b> <i>. That saves a few more bytes, but can join words together, so check the page afterwards.
Does minifying make a site faster?
Smaller HTML downloads a little faster. The biggest gains usually come from gzip or Brotli compression on the server, which works even better on clean, minified code.
Is my code uploaded?
No. Everything runs in your browser.