Code Minifier
Minify JavaScript, CSS, and HTML code to reduce file sizes.
How Code Minifier Works
What is Code Minification?
Minification removes unnecessary characters from source code without changing its functionality: whitespace, comments, line breaks, and redundant syntax.
This reduces file sizes significantly, leading to faster page loads and lower bandwidth usage.
How to Use
- Select the language (JavaScript, CSS, HTML, or SVG).
- Paste or type your code into the input field. The minified output updates live.
- The compression ratio shows how much smaller the output is.
- Click the lightbulb icon to load sample code for testing.
Supported Languages
| JavaScript | Terser-powered: dead code elimination, variable mangling, multi-pass compression |
| CSS | Removes comments, collapses whitespace, shortens colors and zero values |
| HTML | html-minifier-terser: collapses whitespace, removes comments, minifies inline CSS/JS |
| SVG | SVGO-powered: optimizes paths, removes metadata, shortens colors |
Important Notes
- Always test minified code before deploying to production.
- Minification is not obfuscation. The code can still be reverse-engineered.
- Keep your original source files. Minified code is not meant to be edited.
Privacy & Security: All minification runs entirely in your browser. No code is sent to any server.
Language