JavaScript Minifier

Free JavaScript Minifier Online

A JavaScript minifier is a tool that parses JavaScript and rewrites it into a smaller equivalent file. This free online JavaScript minifier uses Terser in your browser to compress code, remove comments, and shorten local names with no upload required.

Paste a script or upload a .js file, tune compression options, then copy or download a production-ready .min.js file with file-size savings and a rough gzip estimate.

Minifier options

JavaScript input

658 B

Minified output

How to minify JavaScript

1

Paste JavaScript

Paste a script, module, or bundled JavaScript into the input editor. The tool accepts modern ES2020 syntax.

2

Choose options

Toggle compression, name mangling, ES module mode, console removal, and license comment preservation.

3

Click Minify JS

Run Terser in the browser to generate a smaller JavaScript file and file-size savings metrics.

4

Copy or download

Copy the minified code or download it as a .min.js file for production use.

What this minifier does

Parses before it rewrites

Terser parses the JavaScript AST before changing code, which is safer than deleting whitespace with regular expressions.

Compresses and mangles

Compression removes dead branches and folds safe expressions. Name mangling shortens local variables to reduce payload size.

Stays private

The minifier runs client-side in your browser, so proprietary scripts and unreleased bundles do not leave your device.

Frequently Asked Questions

What is a JavaScript minifier?

A JavaScript minifier is a tool that parses JavaScript and rewrites it into a smaller equivalent file by removing comments, whitespace, and optional syntax while preserving behavior.

Does this JavaScript minifier rename variables?

Yes. When mangle names is enabled, Terser shortens local variable and function names where it is safe to do so. Public object properties are left alone by default.

Is it safe to minify production JavaScript?

Yes, when the input is valid JavaScript and you review options that change behavior, such as dropping console calls. This tool uses Terser, the same minifier used by many production bundlers.

Does this tool upload my code?

No. The minifier runs in your browser, so pasted JavaScript is not uploaded, logged, or stored by NitroClaw.

Should I minify JavaScript before gzip or Brotli?

Yes. Minification removes unnecessary source bytes first, then gzip or Brotli can compress the smaller output even further during delivery.

Related Tools