Code Minifier
Minify JavaScript, CSS and HTML instantly. Real-time size reduction stats. Free, private, no upload.
Input
Output
Minified output will appear here
About Code Minifier
The Code Minifier removes whitespace, comments, and unnecessary characters from JavaScript, CSS, and HTML to produce the smallest possible output file. Paste your code and download or copy the minified version instantly — no build tools or npm packages required for quick one-off tasks.
Use Cases
- →Minify a JavaScript file for production deployment to reduce load times
- →Reduce CSS file size before publishing a static website
- →Compress HTML to shave bytes off critical rendering path resources
- →Quickly minify a snippet to include inline in a webpage or email template
Tips
- ✓Always keep your original unminified source files — minified code is hard to edit
- ✓Minified JS and CSS combined with gzip compression achieve even smaller file transfers
- ✓Use the Code Formatter tool to reverse-minify (beautify) code for debugging
Frequently Asked Questions
Minification removes all unnecessary characters from source code — whitespace, comments, long variable names — without changing its behavior. The result is a smaller file that loads faster in browsers, which improves page speed and SEO rankings.
Typical results: JavaScript sees 60–80% reduction (terser also renames variables to single letters), CSS sees 30–60% reduction (removes whitespace and optimizes shorthand properties), HTML sees 10–30% reduction (removes comments and collapses whitespace between tags).
CSS and HTML minification is fully reversible — it only removes whitespace and comments. JavaScript minification with variable renaming (mangling) is not easily reversible. Always keep your original source files. Use source maps in production if you need to debug minified JS.
JavaScript is minified using Terser, the industry-standard JS minifier used by Webpack, Vite, and most modern build tools. It performs dead code elimination, constant folding, and variable mangling to achieve maximum size reduction.
Yes. Terser supports modern JavaScript including arrow functions, template literals, destructuring, async/await, optional chaining, and all ES2020+ features. The minified output preserves the original syntax — it does not transpile to older JavaScript.
No. All minification runs entirely in your browser. Your code never leaves your device and is never stored anywhere. This tool works offline once the page has loaded.