Skip to main content
Website Tools

HTML Minifier

Instantly minify HTML by removing unnecessary whitespace and comments, right in your browser.

Paste your HTML below to instantly minify it - entirely in your browser, nothing is sent to our servers.

The minifier removes HTML comments, indentation, line breaks and the whitespace between tags, while leaving the contents of <pre>, <textarea>, <script> and <style> blocks untouched so code and preformatted text keep working. Removing whitespace between tags can occasionally remove a visible space between inline elements such as two links or buttons, so check the page after minifying it. For the biggest size savings, also enable GZIP or Brotli compression on your server. JustChecker builds tools that respect your data - this one never leaves your browser.

Frequently Asked Questions

No - this tool runs entirely in your browser using JavaScript. Nothing you paste is transmitted anywhere.

Yes - this tool only removes whitespace and comments, and carefully protects the content of <pre>, <textarea>, <script>, and <style> tags where whitespace can be meaningful, so it never changes how your page actually renders.

It depends on how much whitespace and how many comments your original HTML has - typically 5-20% smaller for normally-formatted, human-readable HTML.
Share this tool: