HTML / CSS / JS Minifier
Minify HTML, CSS and JavaScript free online with Terser.
How to use this tool
Pick a language
Switch between the HTML, CSS and JavaScript tabs.
Paste & minify
Paste your code and hit Minify — savings shown instantly.
Copy or download
Copy the minified output or download it as a file.
Frequently asked questions
How does the JavaScript minifier work?
We use Terser — the industry-standard open-source JS minifier — running entirely in your browser. It removes whitespace, shortens variable names and applies safe compressions.
Will minifying break my code?
For valid code, no. HTML/CSS minification only removes comments and redundant whitespace. If Terser hits a syntax error it stops and tells you exactly what's wrong instead of producing broken output.
Is my code uploaded anywhere?
No. All minification happens locally in your browser. Your code never leaves your device.
What's a good size saving to expect?
Typically 20–40% for HTML/CSS and 30–60% for JavaScript, depending on how much whitespace and how long your variable names are.
Can I minify ES modules / modern syntax?
Yes — Terser 5 supports modern JavaScript including modules, optional chaining and nullish coalescing.
