Useful Hacks

HTML Minifier

Compress HTML by stripping comments and whitespace.

Processed locally in your browser. Nothing you enter is uploaded or stored.
  • Also minifies inline `<style>` and `<script>` blocks, not just the surrounding markup.
  • Removes redundant attributes and shortens the doctype where safe.
  • Runs in your browser; markup isn't uploaded.

Why this is private

  • Processed locally in your browser. Nothing you enter is uploaded or stored.
  • Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
  • Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.

Overview

Compresses HTML by removing comments and collapsing whitespace between tags, and also minifies any inline <style> and <script> content it finds.

How to use it

  1. 1Paste HTML markup.
  2. 2The minified output updates automatically.
  3. 3Copy it or download as .html.

Tips

  • Whitespace between inline elements and text can occasionally be visually significant — check the result if your markup relies on a specific space between, say, two `<span>` elements.

Frequently asked questions

What people use it for

Shrink a static HTML page before deploying itStrip comments and whitespace from a hand-written page or email template.
Compress an embedded style or script blockMinify inline CSS/JS along with the surrounding markup in one pass.
Reduce the size of a generated HTML snippetClean up output from a template engine before storing or sending it.

Related guides

Related tools

All developer tools

Ready to use HTML Minifier?

HTML Minifier

Search tools

Search for any tool by name, category or keyword