JavaScript Minifier & Formatter
Minify or beautify JavaScript with a real parser, in a sandboxed web worker.
Loading tool…
How to use it
- Paste your JavaScript source in the input box.
- Press Minify for compressed production output, or Beautify for a readable, consistently indented version.
- The code is parsed with Terser inside a Web Worker, so the page never freezes — and strings, template literals and regexes survive intact.
- Parse errors are reported verbatim by the parser, with the offending line.
About this tool
Uses a proper JavaScript parser instead of string replacements, so string literals, template literals and regexes inside your code survive intact. The heavy parsing runs in a web worker to keep the page responsive. Output size is compared with the input so you can see the savings.
Your input never leaves the browser: this tool works entirely offline once the page has loaded.
Frequently asked questions
Why does the minified code rename my variables?
Mangling replaces local names with shorter ones — standard minifier behavior. Exported names and top-level bindings meant for external use should be kept via terser options in your own build; the tool default mangles freely.
Does my code leave the browser?
Never. Terser runs inside a Web Worker on your machine; the page only ships the parser library itself.