JavaScript

Minify JS

Output compact JavaScript and remove comments.

What does this tool do?

This tool removes comments and unnecessary whitespace from JavaScript while preserving strings, template strings and regular expressions.

HTTP/HTTPS up to about 1.5 MB
Allowed: .js, .mjs, .txt
Show / hide explanation of the options

JS safe mode (careful): Conservative minification without risky syntax rewrites.

Keep /*! license comments: Keeps block comments that start with /*! such as MIT or GPL licenses.

Remove // line comments: Removes real // comments while preserving strings, URLs and RegEx literals.

Priority: If URL and upload are both provided, the upload wins. Then URL, then the text field.

Note: If URL and upload are both provided, the upload wins. Content is processed as UTF-8.