Bytelify

JS Minify Tool

Minify JavaScript with real variable renaming and dead-code removal, live as you type.

Runs in your browser, nothing sent
javascript-minifier
Minified

Minified with Terser (real minification — renamed variables, removed whitespace/comments, shortened where safe), live as you type. Runs entirely in your browser; nothing you type is sent anywhere.

Need the opposite? JavaScript Obfuscator

What is JS Minify Tool?

Paste JavaScript and get it minified instantly using Terser, the same production-grade minifier used by major build tools. Real minification (shortened variable names, removed whitespace and comments, dead-code elimination), not just a whitespace strip.

How to Use JS Minify

  1. 1

    Paste the JavaScript: Enter the source code you want to shrink.

  2. 2

    Read the Minified Result Instantly: The minified output appears automatically as you type.

  3. 3

    Copy the Result: Use the copy button to copy the minified code for production.

How It Works

Terser parses the code into an AST and applies several transforms: local variable and function names are renamed to short single/double-letter identifiers where it's safe to do so (names visible outside the scope, like exported functions or global references, are left alone), all whitespace and comments are removed, code that can never execute (like an `if (false)` branch or code after a `return`) is eliminated, and simple constant expressions are folded (e.g. `2 * 60` becomes `120`).

Example

Before
function calculateTotal(price, quantity) {
  // apply the quantity multiplier
  const total = price * quantity;
  return total;
}
After
function calculateTotal(t,a){return t*a}

The comment, whitespace, and the intermediate `total` variable are gone, and the parameters are renamed to single letters.

Common Use Cases

  • Shrinking a JavaScript file before shipping it to production, reducing the bytes a browser has to download and parse.

  • Compressing a script meant to be pasted inline into a `<script>` tag or a size-constrained embed.

FAQs

Frequently Asked Questions

Common questions about JS Minify Tool.

Yes, Terser is what webpack, Rollup, and Vite use by default for JS minification in production builds, running here entirely in your browser via WebAssembly-free pure JS.

Terser is widely used in production and generally safe for standard JavaScript, but always test minified output before shipping it, the same as you would with any build tool.

Not meaningfully. Minification's goal is smaller file size, so renaming is limited to what's safe and useful for that; for code specifically hardened against casual reading, use the dedicated JavaScript Obfuscator instead.

Yes, Bytelify's JS Minify tool is free with no account or sign-up required.

No. Minification runs entirely client-side in your browser via Terser's JS build, so nothing you paste is sent anywhere.