Minify JavaScript to reduce file size. Removes comments, whitespace and newlines.
This free online JavaScript minifier removes comments, collapses whitespace, and strips unnecessary newlines to produce compact JS files that load faster in the browser. Reducing JavaScript file size directly improves Time to Interactive (TTI) and Largest Contentful Paint (LCP) metrics, which are key ranking signals in Google Search. The tool runs entirely in your browser and displays the exact byte savings after each minification.
A JavaScript minifier reduces JS file size by removing whitespace, comments, newlines and unnecessary semicolons. More advanced minifiers (like Terser or UglifyJS) also shorten variable names, eliminate dead code and inline small functions. Smaller JS files download faster, parse faster and improve Time to Interactive (TTI) and Largest Contentful Paint (LCP) - two critical Core Web Vitals metrics.
Basic minification (removing whitespace and comments) typically reduces file size by 20-40%. Combined with gzip or Brotli compression on the server, total transfer size reductions of 60-80% are common. For a 100 KB JS file, that can mean serving only 20-30 KB over the network, significantly improving page load speed especially on mobile connections.
Basic whitespace minification can be reversed using a JavaScript beautifier (available at ziptools.io/tools/js-beautifier). However, if variable names have been mangled by an advanced minifier like Terser, it cannot be fully reversed - the logic is preserved but original variable and function names are permanently lost. Use a source map in development to map minified code back to the original.
For production projects, a build tool like Webpack, Vite, Rollup or esbuild is recommended - they minify automatically on every build, generate source maps and integrate into your workflow. This online JavaScript minifier is ideal for quick one-off tasks: minifying a small script, compressing a bookmarklet, checking how much a snippet compresses, or working without a local build environment.
Yes. This free JavaScript minifier runs entirely in your browser - your code is never uploaded to or processed on any server. It is safe to use with proprietary code, API integrations, internal tools or client work.