HTML Formatter
Tidy up or minify HTML.
Thanks.Tell us why
Runs on your device. Nothing to upload.
What each option does
- Format
- Minify
- Same page
Questions
Will formatting change how my page looks?
No. The formatter follows CSS whitespace rules: it only adds or removes whitespace where the browser ignores it. Inline elements that touch, like <b>a</b><i>b</i>, are kept touching.
How much does minifying save?
Typically 10 to 25 percent on hand-written HTML, more with many comments or deep indentation. Your server’s gzip or Brotli compression saves far more, so minify in addition to compression, not instead of it.
Are conditional comments kept?
Yes. Comments starting with <!--[if are kept, since older browsers act on them. All other comments are removed when minifying.
Does it fix broken HTML?
Formatting needs markup it can read: an unclosed tag or a stray </div> is reported with its line and column so you can fix it. Minifying doesn’t check the markup.
Is it free? Do I need an account?
It is free to use and there is nothing to sign up for. There are no watermarks and no daily limits.
Missing something, or not working as it should? Tell us