JavaScript Minifier

    Remove comments and whitespace to compress your JavaScript

    Instant Minify

    Compress JS with one click

    100% Private

    Runs entirely in your browser

    No Signup

    Free tool, no registration required

    JavaScript Minification Explained

    JavaScript minification transforms source code into a functionally equivalent but much smaller form. Unlike CSS minification (which only removes whitespace and comments), JS minification goes further: it renames local variables to single letters, removes dead code branches, inlines simple expressions, and collapses consecutive statements. The result executes identically to the original but is often 50–80% smaller — a 100 KB script might minify to 30 KB.

    Why Minify JavaScript?

    JavaScript is parser-blocking: large scripts delay the browser from becoming interactive. Google's Core Web Vitals measure Time to Interactive (TTI) and Total Blocking Time (TBT), both heavily influenced by JS bundle size. Smaller files download faster, parse faster, and compile faster in the browser's JIT compiler. Serving minified JS is standard practice for any production web application — frameworks like Next.js, Create React App, and Vite minify automatically during production builds.

    Minification vs Bundling vs Transpilation

    These are three distinct steps often performed together by build tools. Transpilation (Babel, TypeScript compiler) converts modern JavaScript syntax to older equivalents for broader browser support. Bundling (webpack, Rollup, esbuild) combines many modules into fewer files to reduce network round trips. Minification (Terser, esbuild, SWC) reduces the size of each bundle. This tool performs minification only — it does not transpile or bundle.

    How to Use This Tool

    Paste your JavaScript into the input area and click Minify. The minified output appears instantly, along with the reduction in file size. For bookmarklets, inline scripts, or configuration snippets, this tool is a quick way to compress code for embedding. For production applications, use a proper build pipeline with Terser or esbuild integrated into your bundler — they produce better output and handle source maps for debugging.

    Frequently Asked Questions