CSS shrunk with csso
Minifying a nicely formatted "body { color: red; margin: 0; }" rule with csso produces body{color:red;margin:0}, with whitespace and line breaks removed.
Minify JavaScript, CSS and HTML online with Terser, csso and html-minifier — free code minifier.
About
Minifies JavaScript, CSS or HTML using the exact same real minifiers popular build tools use — Terser for JavaScript, csso for CSS and html-minifier-terser for HTML — loaded from this site and run entirely in your browser.
Developers use it to shrink a snippet without setting up a build tool, while performance-conscious site owners use it to check how much smaller a file gets. It's one of many free developer tools on Toolapt, and like every tool here, it's free to use with no sign-up and no limit on how many times you run it.
Examples
3 worked examples
Minifying a nicely formatted "body { color: red; margin: 0; }" rule with csso produces body{color:red;margin:0}, with whitespace and line breaks removed.
Minifying "function add(a, b) { return a + b; }" with Terser produces function add(a,b){return a+b}, since Terser also shortens code where it's safe to.
Minifying a multi-line <div><p>Hi</p></div> block with html-minifier-terser produces <div><p>Hi</p></div> on one line, with indentation and line breaks stripped.
FAQ
Quick answers to common questions about the Code Minifier.
It minifies JavaScript, CSS or HTML using the same real minifiers — Terser, csso and html-minifier-terser — that popular build tools use.
Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.
Yes. Your code is minified entirely on your own device. The real minifier library for your chosen language loads from this site the first time you use it, but your code itself is never uploaded.
JavaScript (via Terser), CSS (via csso) and HTML (via html-minifier-terser).
It depends on the code — the result shows exact before/after size stats after each run so you can see the real reduction.
No. Minification removes whitespace and shortens names where safe to do so; it isn't designed to hide logic the way dedicated obfuscation tools are.
Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.
It minifies one language at a time; mixed-language files (like HTML with embedded JavaScript) are minified as HTML, not split apart.
Did Code Minifier work for you?