tool hub Tool Hub

JS/CSS Minifier

JS/CSS Minifier — runs in your browser. Inputs are not stored.

Runs in your browser No sign-up Free to use


Basic JS / CSS minify

Mode

Enter values, then press Calculate.

Original0
After minify0

Simply strips comments and whitespace. Not a substitute for advanced obfuscation or a bundler.

How to use

  1. Under mode, choose JavaScript or CSS. Default is JavaScript.
  2. Paste code to minify in source.
  3. Press Minify. Code with comments and whitespace reduced appears in result.
  4. In the stats above, compare original and minified character counts.
  5. Copy result takes it. Reset resets source, result, and numbers, and restores mode to JavaScript.

Key concepts

JS/CSS minify is a light shrinker that strips comments and whitespace to shave a little size just before deploy. JavaScript mode removes block and line comments and glues spaces around braces and operators; stylesheet mode removes block comments then glues spaces between selectors and braces. It does not obfuscate names, tree-shake, or analyze scope, so it does not replace a bundler or Terser. It is suited to eyeballing bytes on a small snippet.

Original and minified numbers are input/output string lengths. Slashes in regex literals or comment-like patterns inside strings can be misread, so complex source is safer minified in a build pipeline. JS/CSS minify does not upload files; it only substitutes in the browser. It is not a production-bundle quality tool, but a helper to shorten a comment-heavy draft and compare. If minified output looks broken, check the mode, and keep your existing bundle settings for the final deploy copy. After you eyeball the size difference on a short function or one block of rules, copy it.

Example

In JavaScript mode, paste function hello() { /* greet */ console.log("hi"); } and minify: comments and whitespace disappear and it glues toward one line. Original and minified character counts update in the stats.

Related: JS/CSS formatter · HTML formatter · JSON formatter

Frequently asked questions

Is JS/CSS minify the same as a bundler or Terser?

No. It only strips comments and whitespace with regex. It does not shorten variable names or remove dead code.

Why split JavaScript and CSS modes in JS/CSS minify?

JavaScript handles line comments and operator spacing; stylesheets treat selector/brace spacing and extra semicolons differently.

What are the original and minified numbers after JS/CSS minify?

They are character counts of the input source and output result. They show shrinkage as string length, not kilobytes.

Can comment-like symbols inside strings break JS/CSS minify?

Yes. Simple substitution can mistake // inside a regex or string for a comment, so use a dedicated minifier for important source.

Is JS/CSS minify source uploaded to a server?

No. Minify, copy, and reset all finish in the browser. There is no file upload.

Does JS/CSS minify Reset change the mode too?

Yes. It sets source, result, and original/minified numbers back to 0 and restores mode to JavaScript.

JS/CSS Minifier cover image
Your input is not sent to the server and disappears when you close the page.

Last reviewed: 2026-09-04