Skip to content
Kordu Tools Kordu Tools

JavaScript Minifier

Runs in browser

Minify JavaScript code with Terser — mangle variables, strip dead code, and show size reduction instantly.

Last updated 01 Apr 2026

Minify JavaScript for production using Terser, the industry-standard ES6+ minifier. Removes whitespace and comments, mangles variable names to single characters, eliminates dead code, and compresses syntax. Shows original size, minified size, percentage saved, and estimated gzip size. Free, browser-based, no code uploaded.

Loading rating…

How to use

  1. 1

    Paste your JavaScript

    Paste your JavaScript code into the input panel on the left.

  2. 2

    Choose minification options

    Toggle Mangle to rename variables to shorter names. Toggle Compress to enable dead code elimination and expression simplification.

  3. 3

    Click Minify

    Click the Minify button to compress your code. Original size, minified size, percentage reduction, and estimated gzip size are shown below.

  4. 4

    Copy the result

    Click Copy to copy the minified JavaScript to your clipboard, ready for your production bundle or CDN.

Frequently asked questions

What is JavaScript minification?
Minification removes whitespace, comments, and optional syntax, and renames variables to shorter names to reduce file size. This reduces bandwidth usage and speeds up page load times without changing what the code does.
What does mangle do and is it safe?
Mangle renames local variables and function parameters to single-character names (e.g. 'firstName' becomes 'a') for further size reduction. It is safe for self-contained scripts and modules but can break code that relies on Function.name, dynamic property access, or eval. Always test minified output before deploying.
What does compress do?
Compress applies logical optimisations: eliminates dead code (unreachable branches), inlines constants, simplifies boolean expressions, removes console.log calls if configured, and collapses nested conditions. These passes reduce both size and parse time.
What JavaScript versions are supported?
Terser supports full ES2020+ including arrow functions, destructuring, async/await, optional chaining (?.), nullish coalescing (??), private class fields (#field), dynamic imports, and top-level await.
Is my code sent to a server?
No. All minification runs in your browser using Terser compiled to WebAssembly. Your code never leaves your device and is not stored or logged.
What is the estimated gzip size?
Gzip size estimates the compressed transfer size your users will receive when your server has gzip or Brotli compression enabled. Most web servers enable gzip by default. Minified and gzip-compressed JS is typically 60–80% smaller than the original source.
Can I use this for TypeScript?
No. Terser processes JavaScript only — it does not strip TypeScript types. Compile your TypeScript to JavaScript first using tsc or esbuild, then paste the compiled output to minify.
Does this work with ES modules (import/export)?
Yes. Terser handles ES module syntax including named exports, default exports, re-exports, and dynamic import(). Tree-shaking (removing unused exports) requires a bundler like Rollup or webpack — Terser alone does not perform cross-module dead code elimination.
Can I minify multiple files at once?
This tool processes one file at a time. For automated multi-file minification as part of a build pipeline, use Terser's Node.js CLI or API, or integrate it via webpack/Vite/Rollup plugins.

JavaScript Minifier compresses JS files for production using Terser, the same engine

behind webpack, Vite, and esbuild's minification step. It removes whitespace,

comments, and unnecessary syntax, then optionally mangles variable and function names

to the shortest possible form and applies compression passes to eliminate dead code

and simplify expressions.

The results panel shows original file size, minified size, percentage reduction, and

an estimated gzip size so you understand the real transfer savings once your server

applies compression.

Terser supports the full modern JavaScript surface: ES6+ arrow functions,

destructuring, template literals, async/await, optional chaining, nullish coalescing,

private class fields, and top-level await. Mangle mode renames local variables to

single letters (firstName becomes a) for maximum compression — safe for most code

but always worth testing. Compress mode applies logical simplifications like removing

unreachable branches and inlining constants.

All processing runs in your browser with no code sent to any server. Paste your

unminified JS, click Minify, and copy the production-ready output.

Related tools

Learn more