OpenReplay Logo
12k
12k

HTML minifier

Minify HTML in your browser to shrink page size — collapse whitespace and strip comments, then copy the result. No uploads.

Beautify instead → Processed locally

About this tool

Minifying HTML removes the characters a browser doesn't need — extra whitespace between tags, HTML comments and redundant attributes — to reduce the bytes sent over the wire. Smaller HTML means faster page loads, especially on slow connections.

Paste your markup and the minified output appears with a before/after size comparison so you can see how much you saved. Copy the result with one click, or use the HTML formatter to expand it back for editing.

Minification runs locally; embedded CSS and JavaScript are left untouched — use the dedicated CSS and JavaScript minifiers for those.

Frequently asked questions

What does the minifier remove?

Whitespace between tags and within text, plus HTML comments. The contents of <pre>, <textarea>, <script> and <style> and IE conditional comments are preserved, so the visible page is unaffected.

Does it minify inline CSS and JavaScript?

No — it minifies HTML structure only. For embedded or external styles and scripts, use the CSS minifier and JavaScript minifier, which are linked below.

How much smaller will my HTML be?

It depends on how much whitespace and how many comments the source has; the tool shows the exact byte count and percentage saved.