CSS & JS Minifier Online — Free Tool

Compress your CSS and JavaScript code by stripping unnecessary whitespace and comments to optimize load times.

Note: This is a best-effort minifier (no full parser). For production builds, use a bundler/minifier.
Privacy note: All processing happens entirely in your browser. No data is sent to our servers.

About this tool

Minification removes whitespace, comments, and optional semicolons from CSS and JavaScript to shrink file size for production. Paste source and copy the minified bundle for deployment or quick tests.

Always keep an unminified source copy—minified output is hard to debug.

Common use cases

  • Shrinking assets before CDN upload
  • Quick size checks during performance audits
  • Embedding tiny scripts inline in HTML
  • Comparing gzip savings after minify

How to use

  1. Select CSS or JavaScript mode.
  2. Paste unminified source code.
  3. Run minify and review size reduction.
  4. Copy minified output into build pipeline or HTML.

This page is available at /tools/css-js-minifier/.

Understanding the result

  • Byte reduction helps network time; gzip may compress whitespace anyway but minify still helps.
  • Broken syntax minifies to broken code—validate in browser after minify.
  • Some minifiers rename locals only in advanced build tools; browser paste minify is usually whitespace-only.
  • Keep source maps in real builds for production debugging.

FAQ

Is minify safe for all JS?

Valid syntax minifies safely. ASI edge cases are rare but test critical code paths.

CSS variables minified?

Custom properties (--var) remain; comments and spaces are stripped.

Use this instead of Webpack?

Production apps should use bundler minify (esbuild, terser). This tool suits quick one-off tasks.

Is code uploaded?

No. Minification runs in your browser.