Home › Toolkit › Developer › JS / CSS Minifier

🗜️ JS / CSS Minifier

Every kilobyte your visitors download is time they spend waiting. This minifier removes comments and collapses whitespace from JS and CSS safely — string-aware, so nothing inside quotes is ever touched.

About this tool

Minification is the cheapest performance win on the web: source files written for humans carry comments, indentation and blank lines that browsers must download but never use. This tool removes them with a string-aware scanner — it knows when it is inside a quoted string, a template literal or a regular expression, and never trims there. Semicolons and significant spaces are kept; what disappears is only what the language never needed.

The honest boundary: this is a whitespace-and-comments minifier, not an obfuscator or a bundler. It will not shorten variable names or merge files, so expect solid savings (comments and layout are often a third of a hand-written file) rather than the extreme ratios of a full build pipeline. For a snippet, a single file, or a site without a build step, that is precisely the useful trade.

How to use it

  1. Choose JavaScript or CSS.
  2. Paste the code.
  3. Press Minify; check the size report, then copy the result.

Good to know

  • Keep your unminified original as the source you edit — minified output is a delivery format, not a working format.
  • Test after minifying, as with any optimisation: one page load tells you the behaviour survived.
  • CSS savings compound across every page of a site, since the stylesheet downloads once and caches.

Frequently asked questions

Is string-aware minifying really necessary?

Yes. A naive remover breaks code the moment a string contains // or a space pattern it dislikes. This scanner tracks strings, templates and regexes and leaves their contents alone.

Does it rename variables for extra savings?

No — renaming is a compiler's job and can break code that relies on names. This tool sticks to whitespace and comments.

Is my code sent to a server?

No. Everything happens in your browser.

More Developer tools

Making videos too? Try our YouTube SEO Checker, or browse the full Toolkit and the free YouTube tools.