JS & CSS Minifier
Remove whitespace and comments from JavaScript and CSS. See exactly how many bytes you save.
About the JS & CSS Minifier
Minification removes all characters from code that aren't necessary for it to execute — whitespace, comments, and long variable names can all be shortened. The result is a smaller file that loads faster in browsers.
What this minifier does
- Removes single-line (
//) and multi-line (/* */) comments - Collapses whitespace and newlines
- Removes spaces around operators and punctuation
- CSS only: shortens 6-digit hex colours to 3-digit where possible
- CSS only: removes trailing semicolons before closing braces
All processing runs in your browser — no code is sent to any server.
Frequently Asked Questions
Does this work for both JS and CSS?
Yes. Toggle between JS and CSS mode. Both remove whitespace and comments; CSS mode also shortens hex colours and removes redundant semicolons.
Is the minified code safe to use?
Yes for typical code. For complex production builds with frameworks, a full bundler like webpack or esbuild is recommended as it also handles imports and tree-shaking.
How much smaller will my file be?
Typically 20–40% for well-commented code. Combined with gzip compression on the server, total reduction can reach 70–80%.