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.
- Paste JavaScript or open a file.
- Choose whether to Shorten local names and run Minify.
- Check the result through the project’s ordinary entry points.
- 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.