HTML Minify
Compress HTML by removing comments, whitespace and redundant markup, optionally minifying inline styles and scripts.
- Runs in your browser
- Free to use
About this tool
The HTML Minifier runs the well-known html-minifier library in your browser to strip comments, whitespace and redundant attributes, with optional inline CSS/JS minification and removal of optional tags. The result shows input and output sizes with the percentage saved. Since the processing is local, you can minify templates containing secrets or customer data.
Reverse it with HTML Unminify.
How to use it — quick steps
- 01
Enter the html
Type or paste the html in the field above, for example <!-- header -->. Nothing is uploaded.
- 02
Adjust the options
Pick the settings that fit your case; the defaults work for most people. Changes apply instantly.
- 03
Press "Minify HTML"
Press "Minify HTML" or Ctrl + Enter. The result appears instantly below the form. Results can be copied.
Key features of this tool
Nothing leaves your browser
The processing is plain JavaScript that runs on your device: the text you paste is never uploaded to our servers or to anyone else.
Instant results
Results appear the moment you press the button, even for long inputs, and every block has copy and download actions.
Works everywhere
No installation, no account and no limits: the tool works on desktop and mobile, in any modern browser, as often as you like.
Frequently asked questions
Will minification break my page?
The default options are safe. "Remove optional tags" and "remove attribute quotes" are valid HTML5 but can confuse old tools; test before deploying.
How much does it save?
Typically 10–30% on hand-written templates, less on already compact markup; gzip on the server adds much more.
Are my files or data uploaded?
No. The tool is plain JavaScript that runs in your browser; the files or data you provide here are never uploaded to our servers.