ZapToolbox

CSS & HTML Minifier

Shrink CSS and HTML by removing comments and unneeded whitespace — safely, without touching strings or preformatted content.

🔒 Runs entirely in your browser — nothing you type is uploaded.

How to use the CSS & HTML Minifier

  1. Choose CSS or HTML and paste your code.
  2. Click “Minify”.
  3. Copy or download the result and keep the original for editing.

About this tool

Minifying removes characters browsers don’t need — comments, indentation and line breaks — so pages download faster. The CSS minifier keeps quoted strings and /*! licence */ comments exactly as they are and only removes spaces where CSS ignores them (around braces, colons, semicolons and commas), leaving spaces inside values like calc(100% - 10px) alone.

The HTML minifier removes comments and collapses whitespace, but leaves <pre>, <textarea> and <script> contents untouched. JavaScript minification isn’t offered because doing it safely needs a full parser; use your build tool (esbuild, Terser) for that. Keep your original files — minified code is hard to edit.

Frequently asked questions

Is minified CSS different in behaviour?

No — only ignorable whitespace and comments are removed. Always test after minifying, especially with unusual hacks.

Why is there no JavaScript minifier?

Safe JS minification needs a real parser to handle regex literals, template strings and automatic semicolons. A build tool like esbuild or Terser does it properly.

How much smaller will my files get?

Typically 15–30% for hand-written CSS and HTML. Server compression (gzip/brotli) saves even more on top.