Skip to main content
Developer Tools

JS & CSS Minifier

Minify JavaScript or CSS instantly. Free, private, browser-based.

How to Use

  1. 1. Select JavaScript or CSS.
  2. 2. Paste your code into the input area.
  3. 3. Adjust the options if needed, then click Minify.
  4. 4. Copy the result or download it as a file.

About This Tool

Minification removes everything from source code that isn't needed for it to run — whitespace, comments, and (for JavaScript) long variable names — without changing what the code does. Smaller files download faster and parse faster in the browser.

This tool uses Terser for JavaScript and CSSO for CSS — the same libraries used by production build tools like Webpack and Vite — so the output matches what you'd get from a real build pipeline.

Everything runs locally in your browser. Your code is never uploaded to a server.

You may also find our JSON Formatter, CSS Gradient Generator, and Regex Tester helpful.

Frequently Asked Questions

Does minifying change how my code behaves?

No. Minification only removes whitespace, comments, and (for JavaScript) shortens variable names — the logic stays identical. If mangling variable names is a concern (e.g. code that relies on Function.prototype.name or global variable names), turn off "Mangle names".

What does "Drop console.log" do?

When enabled, all console.log/console.info/console.debug calls are removed entirely from the JavaScript output — useful for production builds where debug logging should not ship.

What does "Structural optimizations" do for CSS?

It merges and reorders rules where safe to produce smaller output (e.g. combining duplicate selectors). It is safe for the vast majority of stylesheets, but if your CSS relies on very specific rule ordering, you can disable it.

Is my code uploaded anywhere?

No. Minification runs entirely in your browser using the same libraries (Terser for JS, CSSO for CSS) used by professional build tools. Nothing is sent to a server.

Was this tool helpful?

Share: