DEVELOPER TOOLS

JavaScript Minifier & Beautifier

Compact or format JavaScript with a real parser. Your code is processed locally and never executed by this tool.

Comments & optional cleanup

Cleanup is off by default. Removing console calls also removes side effects inside their arguments. Removing comments can remove license notices and tool annotations; keep notices required by your dependencies.

Original code

Processed code

Input UTF-8 bytes 0Output UTF-8 bytes 0Size change —Output lines 0
What this tool does

Minify reduces whitespace using Terser 5.51.2. Beautify prints parsed code with two or four spaces. Variable, function and class names are preserved; general optimization and name mangling are disabled. Formatting may normalize quotes, literals and parentheses.

Check syntax reports parser errors, not a complete lint or runtime check. Successful parsing does not mean the code will work in every browser. Choose ES module for imports, exports or top-level await. TypeScript and JSX are not supported. Your input is not run, saved or uploaded.

Limits: 250,000 input UTF-16 units and 1 MB files. Processing runs in a worker with an 8-second timeout. Copy/export require a successful processing result. Size change compares raw UTF-8 byte sizes, not gzip or network transfer size.

Using JavaScript Minifier & Beautifier

Compact JavaScript or print it with readable indentation. A locally bundled Terser parser handles strings, regular expressions, templates and statement boundaries.

  1. Paste code or open a JS file, then choose Minify or Beautify.
  2. Choose Script or ES module. Keep cleanup off unless you intend to remove console calls or debugger statements.
  3. Run, inspect the output and size change, then copy or download it. Check syntax reports parser errors without running your code.

Example

Input: const url = "https://example.com"; console.log(url);
With default options, the URL and console call remain in the compact output.

Questions & answers

Does minifying automatically remove console calls?

No. Console and debugger cleanup are off by default. Minify changes formatting while preserving names, with general optimization and name mangling disabled.

Can removing console calls change behavior?

Yes. The optional cleanup removes console calls and their argument evaluation. A call such as console.log(saveData()) can stop calling saveData(). Use it only when you intend that change.

Does Check syntax run or fully lint the code?

No. It uses the parser without executing your code. It checks supported syntax, not runtime behavior, style or browser compatibility. TypeScript and JSX are not supported.

What comments are kept?

The default keeps all comments. You can choose to keep license/preserve comments only or remove all comments. Keep any notices required by your dependencies.

Is the displayed size saving gzip compression?

No. It compares input and output UTF-8 byte sizes. Beautified output can be larger. It does not estimate gzip or network transfer size.

Is my code saved or uploaded?

No. Processing runs in a local browser worker, and the input is not executed or saved. Processing has an 8-second timeout and a 250,000-unit input limit.

Help improve this tool

Report a problem or suggest an improvement

Describe the issue without pasting private tool input. Feedback goes to our admin inbox.

Find another tool · Read practical guides