JavaScript Minifier & Formatter

Minify or beautify JavaScript with a real parser, in a sandboxed web worker.

Loading tool…

How to use it

  1. Paste your JavaScript source in the input box.
  2. Press Minify for compressed production output, or Beautify for a readable, consistently indented version.
  3. The code is parsed with Terser inside a Web Worker, so the page never freezes — and strings, template literals and regexes survive intact.
  4. 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.