JavaScript Minifier

Minify a JavaScript source file and optionally shorten local variable names.

Input

Processed on your device

How to use JavaScript Minifier

Make JavaScript smaller for distribution. The tool can shorten local names and compress supported source constructs before writing the result.

  1. Paste JavaScript or open a file.
  2. Choose whether to Shorten local names and run Minify.
  3. Check the result through the project’s ordinary entry points.
  4. Select Minify and review the result.
Example input
const notebook = {title:"Field Notes", copies:12};
console.log(notebook.title);

Example use

Make a smaller version of a single standalone browser script while keeping the original for debugging.

Output and compatibility

The bundled minifier can rewrite code and remove comments. Code relying on function names, reflection, or special comment markers may require custom build options. It does not create a multi-module bundle.

Troubleshooting

If generated code behaves differently, turn off local name shortening and examine how the original refers to names at runtime.

Use JavaScript Formatter to read or review the original.

Frequently asked questions

Can I preserve local names?

Disable Shorten local names. Other supported compression transformations still apply.

Does it run my program?

The browser parses and rewrites the source without executing it.

Find a tool