OpenReplay Logo
12k
12k

JavaScript minifier

Minify JavaScript in your browser to shrink bundle size — powered by Terser. Copy the minified JS. No uploads.

Beautify instead → Processed locally

About this tool

Minifying JavaScript removes whitespace and comments and shortens (mangles) local variable names, producing a much smaller file that downloads and parses faster. This tool uses Terser, the standard minifier behind most modern build tools.

Paste your JavaScript and the minified output appears with a before/after size comparison. Terser also applies compression — dead-code elimination and expression simplification — so the savings are real. Copy the result, or expand it again with the JavaScript beautifier.

Minification runs locally — your code never leaves your browser.

Frequently asked questions

Is the minified code equivalent?

Yes — Terser preserves behaviour while removing whitespace, comments and dead code and mangling local names. Avoid relying on function or variable names at runtime (for example via toString) when mangling is on.

What's the difference between compression and mangling?

Compression rewrites the code to be smaller (folding constants, dropping unreachable branches); mangling renames local variables to short names. This tool applies both.

Will it break my code?

Valid JavaScript minifies safely. Invalid syntax is reported as an error instead of producing broken output.