HTML Minifier

Minify HTML — strip comments and whitespace.

Paste HTML and get a minified version — comments removed and whitespace collapsed — while the contents of <pre>, <textarea>, <script>, and <style> are preserved exactly. It all runs in your browser.

Runs entirely in your browser — nothing is uploaded.

How to use the html minifier

  1. 1Paste your HTML.
  2. 2See the minified output and the size saved.
  3. 3Copy or download the result.

Frequently asked questions

Does it break my scripts or preformatted text?

No — the contents of <pre>, <textarea>, <script>, and <style> are preserved exactly; only the surrounding markup is minified.

Is my HTML uploaded?

No — minification happens entirely in your browser.

Read the guide
How to Minify CSS, JavaScript, and HTML (Free)

Related tools