Minify CSS / JS code
Reduce the size of your CSS or JavaScript code directly in your browser, with no data sent to a server: removes comments and extra whitespace.
Note: this is a basic minifier (removes comments and compresses whitespace), not a full production tool like Terser or csso. It doesn't rename variables and performs no advanced semantic optimization.
How it works
Designed to reduce the weight of a CSS or JavaScript file before publishing a small site or a personal page: paste your source code, choose the language, click "Minify" and get a lighter version (comments and extra whitespace removed) along with the percentage reduction achieved. As noted above on this page, this is a basic minifier suited to a one-off need or learning purpose, not a replacement for production tools like Terser or csso on a large project.
Why doesn't my minified code work anymore?
This is rare but possible with very specific code (for example JavaScript relying on implicit whitespace or semicolons in edge cases). Since this minifier doesn't perform advanced semantic analysis or variable renaming, it's recommended to always test the result before deploying it to production.
What's the difference between minification and gzip compression?
Minification modifies the source code itself (removing comments, whitespace, shortening) and produces a smaller file that remains directly executable as-is. Gzip (or brotli) compression is then applied server-side to the already minified file: it compresses the network transfer without modifying the content, and the browser decompresses it upon receipt. The two techniques are complementary.
Minification runs 100% locally in your browser via WebAssembly: your source code is never sent to a server.