🍪 We use cookies for analytics and advertising to keep EazyStudio free. Learn more
Did you find this tool helpful?
Code Minifier
Minify JavaScript, CSS and HTML instantly. See exact file-size savings and download or copy the optimised output.
Options:
Input JavaScript
Minified JavaScript
What Does Code Minification Do?
Minification removes everything from source code that isn't needed for execution — whitespace, indentation, comments, and newlines. For JavaScript it can also rename variables and functions to shorter names (called mangling), which further reduces file size. The result is functionally identical code in a much smaller file.
A typical JavaScript file sees 20–60% size reduction from minification alone, with CSS files often achieving similar savings. When combined with gzip compression on the server, savings can exceed 80%.
JavaScript, CSS & HTML — What Gets Removed?
JavaScript Minification
This tool uses Terser, the same industry-standard minifier used by Webpack, Vite, and Rollup. It removes comments and whitespace, collapses expressions, and optionally mangles variable names to single characters.
CSS Minification
Spaces around selectors, properties, and values are removed. Comments are stripped. Trailing semicolons inside rule blocks are removed. Empty rules are optionally deleted. The result is a single-line CSS file that loads faster.
HTML Minification
HTML comments are removed. Whitespace between tags is collapsed. Unnecessary spaces within tags are eliminated. The structure and semantic meaning of the HTML is fully preserved.
Frequently Asked Questions
No. Minified code is extremely hard to debug. Keep original source files during development and only minify for production builds. Most build tools (Webpack, Vite, Parcel) minify automatically on production builds.
Yes — positively. Minified files load faster, which improves Core Web Vitals (especially LCP and FID). Google uses page speed as a ranking signal, so faster pages can rank higher. Google recommends minifying CSS, JavaScript, and HTML for all production sites.
Mangling renames local variables and function arguments to shorter names (like a, b, c). It's safe for most code but can cause issues with code that uses eval(), relies on function names, or uses some frameworks that inspect variable names at runtime. Disable it if your minified code causes errors.
No. JavaScript minification runs via Terser loaded from CDN and executes entirely in your browser. CSS and HTML minification use pure JavaScript regex — no data leaves your device at all.
Minification permanently changes the code to make it smaller. Compression (gzip, Brotli) is applied by the web server when transferring files — the browser decompresses them on arrival. Both techniques work together: minify first, then let the server compress the minified file for maximum savings.