DEVELOPER TOOLS

JavaScript Minifier

Minify JavaScript in your browser. Remove comments and whitespace, keep license comments when needed, then copy or download the smaller code.

JavaScript minifier

This safe minifier removes comments and whitespace. It does not mangle names, run unsafe compression, or execute your code.

Minify options
Current minify

-

Reduction
Input bytes
0
Output bytes
0
Bytes saved
0
Output lines
0

Minify valid JavaScript to see the result.

Saved on this device

Recent minify results stay in this browser only.

No data
No saved minify results yet.

How To Minify JavaScript Safely

What this minifier does

Whitespace reduction

The tool removes unnecessary spaces and line breaks while keeping token boundaries that JavaScript still needs.

Comment control

Remove all comments for the smallest snippet, or keep license comments when attribution must stay with the code.

No name mangling

Variable and function names stay the same. That keeps the result easier to debug and safer for snippets.

Common mistakes

Expecting bundle-level compression

This tool does safe text minification. Use Terser or your bundler when you need AST compression and name mangling.

Dropping required comments

Some third-party code includes license comments. Use the license option when you are not sure.

Ignoring automatic semicolon insertion

Line breaks can matter in JavaScript. Keep the ASI guard on unless you know the snippet is already semicolon-safe.

Tips

Use readable compact for review

Readable compact mode is useful when you need smaller code but still want to scan statements.

Check the byte summary

The saved byte count shows whether minifying a small snippet is worth the reduced readability.

Save before trying options

Save a result when you want to compare comment or whitespace settings later in this browser.