HTML
Minifier
Remove comments, collapse whitespace, and reduce your HTML file size. Fast, free, and entirely in your browser.
How It Works
Paste HTML
Paste or type your HTML code into the input area.
Minify
Click Minify to remove comments and collapse whitespace.
Copy or Download
Copy the minified code or download it as an .html file.
Minify HTML online to reduce page weight, save bandwidth, and improve Core Web Vitals scores. ConverterUp's HTML minifier removes whitespace, comments, redundant attributes, and unnecessary quotes while keeping the document structurally valid. Front-end developers and static-site builders can paste their template, click minify, and ship a smaller payload to production. Minification runs in your browser using a deterministic parser, so proprietary markup, internal templates, and unreleased landing pages stay completely private.
Frequently asked questions
How much can HTML usually be minified?
Typical reductions are 15-30 % for hand-written HTML and up to 50 % for documents with heavy whitespace and HTML comments. Combine with gzip or brotli compression for additional savings on the wire.
Does minification break inline JavaScript or CSS?
No. Inline scripts and styles are preserved verbatim by default. Enable the aggressive option to also minify them, which collapses whitespace inside script and style tags.
Will conditional comments and IE hacks be kept?
Yes. Conditional comments such as <!--[if IE]> are detected and preserved because they carry browser-specific logic. Standard comments without semantic meaning are stripped.
What is the maximum HTML size?
Documents up to 5 MB are processed in well under a second. Larger files still work but the editor may feel sluggish; consider minifying as part of your build pipeline for production sites.