JS Tools

Online JavaScript Minifier

Minify and compress JavaScript (via Terser) in your browser; reduce size and improve load times.

Loading tool...

How to use

  1. Paste or type your input in the left editor
  2. Adjust options in the toolbar if available
  3. Copy or download the output from the right pane

This free online tool runs entirely in your browser. No sign‑up, no server uploads.

About Minify JavaScript

Minify and compress JavaScript (via Terser) in your browser; reduce size and improve load times.

The JavaScript minifier parses the source code into an abstract syntax tree (AST), then serializes it back with minimal formatting — removing all comments, unnecessary whitespace, and redundant semicolons. Optionally, local variable names are shortened to single characters (mangling) and constant expressions are pre-evaluated (dead code elimination). The output is semantically identical JavaScript in the smallest possible representation.

Use the left editor to enter your data. The output updates in real time. You can copy, clear, download, or expand either pane.

Tip: Use the search bar to quickly switch between tools.

Sample JavaScript

function greet(n){return "Hello, "+n}
Example input shown above. Output appears in the right pane instantly.

Why this tool?

FeatureMinify JavaScriptTypical alternatives
Free online toolYesOften yes
Client‑side only (privacy)YesVaries
No sign‑up requiredYesVaries

Explore related tools

Looking for more? Browse All tools or check categories like BeautifierMinifier, and Validators.

Related tools

FAQs

How much can JavaScript minification reduce file size?
JavaScript minification typically reduces file size by 30-60%. The largest savings come from removing comments and whitespace, shortening variable names, and eliminating dead code. Combined with gzip compression, total savings can exceed 80%.
Does minification rename my variables?
Basic minification removes whitespace and comments without renaming variables. Advanced minification (mangling) can shorten local variable and function names to single characters for additional size reduction, while preserving all externally visible names.
Will minified JavaScript run the same as the original?
Yes. JavaScript minification is a semantics-preserving transformation. The minified code produces identical behavior — same outputs, same side effects, same error handling — as the original source. Only formatting and comments are removed.
Does the minifier handle ES6 modules and modern syntax?
Yes. The minifier supports all modern JavaScript features including import/export statements, arrow functions, template literals, optional chaining, nullish coalescing, and class declarations. Your modern code is minified correctly.
Should I minify JavaScript before or after bundling?
For optimal results, bundle first with a tool like Webpack, Rollup, or esbuild, then minify the output bundle. This allows the minifier to optimize across module boundaries. This tool is ideal for quick minification of individual files or snippets.