Skip to content
Utiloom

JS Minifier

Minify bounded JavaScript scripts or ES modules with explicit Terser compression, name mangling, comment, and output policies.

LocalNo retention

Reviewed July 13, 2026

Guide, examples, and validation Show

About this tool

Compress standalone JavaScript snippets with an explicit optimization policy and inspect byte savings before downloading the verified result.

JS Minifier is strongest for standalone scripts, embeds, widgets, and experiments where someone needs smaller JavaScript output without opening a bundler. It gives quick feedback on compressed code size and is useful for checking how a snippet behaves after minification.

  • Runs Terser 5.46.0 in a disposable Web Worker with a 10-second processing limit rather than blocking the page during minification.
  • Separates script and ES module optimization assumptions and exposes compression, local or top-level name mangling, name retention, license comment, ASCII-only, and ECMAScript output policies.
  • Reports parser locations and byte savings and enables copy or download only after the result remains identical under the same minification policy.

How to use JS Minifier

Paste the JavaScript, run the minifier, and review the output before copying it into the target embed or prototype. For larger applications, keep your normal build system for production bundles and use this page mainly for snippet-level checks or manual compression tasks.

When this tool is useful

  • Runs Terser 5.46.0 in a disposable Web Worker with a 10-second processing limit rather than blocking the page during minification.
  • Separates script and ES module optimization assumptions and exposes compression, local or top-level name mangling, name retention, license comment, ASCII-only, and ECMAScript output policies.
  • Reports parser locations and byte savings and enables copy or download only after the result remains identical under the same minification policy.

Examples you can test

Load an example, compare the result with the expected output, then replace it with your own input.

Minify a small embed script

Example input

function greet(name) { console.log('Hello ' + name); }

Expected output

function greet(o){console.log("Hello "+o)}

Snippet minification is useful for embeds and prototypes, while production apps should use the build pipeline.

Compare script size

Example input

A formatted widget script

Expected output

Minified output with reduced whitespace and shorter syntax

Review size savings and behavior before replacing readable source code.

Validation checklist

  • Keep the original readable JavaScript as the source of truth.
  • Test behavior after minification when the script will run in production.
  • Avoid pasting secrets, tokens, or private code into shared examples.
  • Check browser compatibility if minification rewrites modern syntax.
  • Use source maps or original files when debugging minified production code.

Frequently asked questions

Is this suitable for production bundles?

Use it for standalone snippets and quick delivery checks. Full applications should keep their normal bundler, source maps, dependency graph, tree shaking, tests, and deployment pipeline.

Will this preserve comments?

The preserve license comments option keeps comments recognized by Terser as license or preservation notices, including /*! and @license forms. Other comments are removed; disable the option to remove those notices too when licensing permits.

Does the minifier rename variables to shorter names?

The shorten local names option mangles eligible local bindings. Top-level names are left intact unless you explicitly enable top-level mangling, which can break names referenced by another script or HTML.

Can I minify ES6+ syntax including arrow functions, template literals, and async/await?

Terser parses supported modern JavaScript and can minify arrow functions, template literals, classes, async functions, and module syntax. The ECMAScript target guides emitted optimizations; it is not a transpiler and does not convert every newer input feature for older browsers.

What changes when I choose ES module?

Module mode enables Terser's module-specific compression assumptions, including strict mode and top-level module scope. Choose it only when the input will be loaded as an ES module.

Related tools

Keep the workflow moving

Continue with tools that handle a related input, output, or validation step.

Developer

CSS Formatter

Format CSS, SCSS, or Less with stable output verification.

Local
Developer

HTML Entity Encoder Decoder

Transform HTML5 character references with explicit context and error policy.

Local
Developer

HTML Formatter

Format HTML with explicit whitespace and embedded-code policies.

Local
Developer

HTML to Markdown Converter

Convert HTML body content into safe, policy-driven Markdown.

Local