Minify HTML, including inline CSS and JavaScript, or beautify messy HTML into clean, indented markup. Shows the size saved.
More:CSS MinifierJavaScript MinifierHTML EntitiesXML Formatter
Minifying removes comments and only the whitespace a browser would never show. Text in <pre> and <textarea> stays exactly as written, the single space between inline elements like <b> and <i> is kept, and IE conditional comments and comments starting with <!--! are preserved. Inline CSS and JavaScript are minified with CSSO and Terser. Beautifying uses Prettier. Everything runs in your browser.
Paste HTML, open a .html file or drop one in. Minify mode collapses whitespace, removes comments and tidies tags, while keeping the content of <pre> and <textarea> exactly as written. CSS inside <style> tags is minified with CSSO and JavaScript inside <script> tags with Terser. JSON-LD structured data is compacted too. Special comments are kept: Internet Explorer conditional comments and comments that start with <!--! are left in place. If tags look unclosed or do not match, a warning lists them so you can check your markup. Beautify mode uses Prettier to indent HTML neatly, including the CSS and JavaScript inside it. Everything runs in your browser; your code is never uploaded.
It should not. Spaces between words and inline elements are kept as single spaces, and the content of <pre> and <textarea> is never changed. Spaces next to block elements, such as <div> and <p>, are removed because browsers ignore them.
Yes. <style> blocks are minified with CSSO and <script> blocks with Terser. If an inline block cannot be minified, it is left as it was and you are told.
Internet Explorer conditional comments and comments that start with <!--! are kept. Other comments are removed when "Remove comments" is on.
It warns about tags that are opened but never closed, or closed without being opened. Elements that do not need a closing tag, such as <br> and <li>, are not reported.