HTML Minifier
Minify HTML: remove comments and extra whitespace, shrink inline CSS and JavaScript, see the size saved. Private, in your browser.
HTML
Stays in your browserResult
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to HTML Beautifier, CSS Minifier or JavaScript Minifier.
Free Online HTML Minifier
Make a page smaller by removing what the browser does not need: comments, extra whitespace and unneeded quotes. It gives developers a quick browser-based way to solve a focused html minifier task before moving the result into a project.
How to use the html minifier
Paste your code in the box, adjust the options if you want, and press Minify. Choose what to remove, then press Minify. Text inside pre and textarea is never touched. Inline style and script blocks can be minified too.
Common mistakes
- Keep the original file: minified code is not meant to be edited or read.
- Test the result before you ship it, especially if the code relies on function names or comments.
- Removing optional closing tags and attribute quotes saves bytes but makes the markup harder to read, so keep them off unless size matters most.