JavaScript minifier & beautifier

Paste your JavaScript, then shrink it by stripping comments and extra whitespace, or tidy it up with clean indentation. Strings, template literals and regex are left untouched. Everything runs in your browser.

Your JavaScript
Mode

This is a lightweight formatter, not a full compiler — it never renames variables, removes semicolons, or rewrites your code. It only strips comments and adjusts whitespace, so the output behaves exactly like the input.

Everything runs in your browser. No upload, no sign-up.

How it works

STEP 1

Paste your JavaScript

Drop in a script or snippet. It is parsed right in your browser — nothing leaves your device.

STEP 2

Minify or beautify

Minify strips comments and collapses whitespace safely. Beautify re-indents with 2 spaces. Strings, template literals and regex are preserved either way.

STEP 3

Copy or download

See how many bytes you saved, then copy the result or download it as a .js file. Nothing is uploaded.