⭐ 0

HTML Minifier Online

Minify CSS, JavaScript, HTML or JSON in the browser: strip comments and whitespace, see the size saved instantly.

Processed entirely in your browser — nothing you enter here is ever uploaded.

Processing... 0%

Result

About this tool

This page opens the code minifier with HTML preselected. It removes HTML comments and collapses the formatting whitespace between tags — the indentation and newlines that make source readable but that browsers mostly ignore — while single spaces inside running text are kept so your visible content renders unchanged.

Elements where whitespace is meaningful are protected: everything inside pre, textarea, script and style tags is copied byte-for-byte. Multi-line tags with wrapped attribute lists are folded into one line. Typical templates and exported pages shrink by 10–25%, which matters for email HTML, where some clients truncate large messages, and for pages served without gzip.

Paste your markup, press the button, and check the size panel for exact before/after bytes and the percent saved. The result can be copied to the clipboard or downloaded as an .html file — everything happens locally in your browser, so unpublished pages stay private.

Example. JavaScript const x = 1; /* note */ loses the comment and the extra spaces, and the panel shows the byte size before and after.

Limit. JavaScript names are not shortened; JSON must parse or it is rejected, and HTML leaves pre, textarea, script and style contents untouched.