Skip to main content

JavaScript / CSS Minify & Beautify

Quick-tokenize and either compress or re-indent JavaScript / CSS source. Runs in the browser.

About this tool

JavaScript / CSS Minify & Beautify runs a quick client-side tokenizer over your source to either compress it (whitespace + comment strip) or re-indent it for readability.

What we handle

  • JavaScript (ES5 + most of ES2020): identifier / numeric / string / regex / template literal / comment / punctuation. The tokenizer tracks string and template contents verbatim so
  • CSS: at-rules, identifiers, hex colors, comments, pseudo-classes, and selector combinators.

Minify

Drops every comment, removes extra whitespace, collapses decimal numbers where safe, and keeps brace / semicolon structure (since dropping ; in a minified file is a common foot-gun). For JS we keep string literals and template-interpolation tokens completely untouched.

Beautify

Re-indents based on a brace counter. Standard 2-space indent by default. Comments are preserved and re-indented to the column they fall on.

What this is NOT

  • Not a real minifier with all the AST-level optimizations (terser / esbuild do that server-side). For production, run a proper minifier as a build step.
  • Not a parser — if your code has a syntax error, the tool will still try to format it but the output will look off.

Use cases

  • Inspect minified JS / CSS you’ve been given to figure out what it does.
  • Re-format a one-off script before pasting into a Stack-Overflow answer.
  • Quick whiteboard between human-readable code and a smaller shareable blob.

Privacy

Pure tokenization in your browser. Nothing is uploaded.