Minifier

JS / CSS Minifier + Beautifier

Paste JavaScript or CSS — hit Minify to strip whitespace + comments for production, or Beautify to re-indent obfuscated / one-line code into a readable form. Auto language detection, all in your browser.

Conservative. We strip comments and collapse whitespace, but we do not mangle identifiers (foo stays foo), do not perform dead-code elimination, and do not reorder statements. The goal is a safe, predictable byte reduction. If you want maximum compression, run the output through Terser or esbuild as a final step.

No. The tokeniser is string-aware, template-literal-aware, and regex-aware. Whitespace and comment-like sequences inside "...", '...', \`...\`, or /regex/flags are preserved verbatim. License banner comments (/*! ... */) are also preserved by default.

Input
Output

Built for everyday JS + CSS workflows

Minify for production, beautify for debugging — and a few small touches that make it actually fun to use.

Two languages, two transforms

JavaScript or CSS, minify or beautify, in one tool. Auto-detect picks the language from content cues; or override with the Language dropdown.

Conservative minify

We strip comments and collapse whitespace — but never mangle identifiers, never re-order, never inline. Strings, template literals, regex, and license-banner comments (/*! ... */) are preserved verbatim. Output is byte-for-byte safe.

Beautify obfuscated / minified code

Paste a one-line minified bundle, hit Beautify, get a readable indented version — useful for inspecting third-party scripts, debugging production stack traces, or learning from clever code.

Size diff at a glance

Every minify shows you the bytes-in → bytes-out delta and percent saved. No need to wonder if your CSS bundle is actually getting smaller.

Privacy by design

Your code stays on your device. Tokeniser, minifier, beautifier all run as JavaScript locally. Open DevTools → Network and verify zero outbound requests.

Tiny + fast

Pure JavaScript, no framework runtime. Cold load is under 25 KB gzipped. A 200 KB JS bundle minifies in under 50 ms on a normal laptop.

How to minify or beautify JS / CSS

Three steps from raw code to production-ready output.

  1. 1

    Paste your code

    Drop JavaScript or CSS into the Input pane. The tool auto-detects which language it is — or pick from the Language dropdown if the source is ambiguous (e.g. a small fragment).

  2. 2

    Pick Minify or Beautify

    Hit Minify to strip comments and whitespace for production. Hit Beautify to expand obfuscated / one-line code with proper indentation. The tool re-runs instantly on every click — switch back and forth to compare.

  3. 3

    Copy or download

    Use the copy icon to push the output to your clipboard, or the download icon to save it as output.min.js / output.min.css / output.beauty.js / output.beauty.css. The size diff (bytes in → out, percent saved) shows you exactly how much you compressed.

Built for daily web-dev work

Four common scenarios where a privacy-first browser tool beats pasting code into a random online minifier.

Inline scripts in HTML email or static sites

Static pages, transactional email templates, and embed snippets often need a one-line inline script or stylesheet. Drop your readable source in, minify, paste the result into the <style> or <script> tag — done.

Reading a third-party script you don't trust

Vendor pixels, ad-network beacons, suspicious extensions — they all ship as minified one-liners. Paste in, hit Beautify, read what they're actually doing before you embed them on production.

Quick CSS audit for a CMS theme

Themes for WordPress / Shopify / Ghost / Webflow ship bloated CSS. Paste the stylesheet, beautify, scan for duplicated rules and unused selectors. When you're done, minify the cleaned-up version back to one line.

Sensitive code that can't go to a third-party service

Internal scripts containing API keys, secrets, business logic — anything you can't paste into a cloud minifier. The browser-only tool keeps every byte on your laptop. Open DevTools → Network and verify nothing leaves.

100% private — runs in your browser

Your code never leaves your device. Open DevTools → Network and you'll see zero outbound requests during minify or beautify.

  • Tokeniser, minifier, and beautifier all run as JavaScript on your machine — no Terser, no esbuild, no third-party API.
  • License-banner comments (/*! ... */) are preserved by default so you don't accidentally strip attribution required by an open-source library's licence.
  • No login, no telemetry on code content. We only use one cookie for cookie-consent state and one for language preference.

Related guides

Hand-picked reads on JS / CSS minification, code formatting, and bundle-size discipline.

Frequently asked

How aggressive is the minifier?

Conservative. We strip comments and collapse whitespace, but we do not mangle identifiers (foo stays foo), do not perform dead-code elimination, and do not reorder statements. The goal is a safe, predictable byte reduction. If you want maximum compression, run the output through Terser or esbuild as a final step.

Will my strings, template literals, or regex break?

No. The tokeniser is string-aware, template-literal-aware, and regex-aware. Whitespace and comment-like sequences inside "...", '...', \`...\`, or /regex/flags are preserved verbatim. License banner comments (/*! ... */) are also preserved by default.

Does the CSS minifier handle nested rules and @media queries?

Yes. Nested rules, @media, @keyframes, @font-face, @layer, @container, @supports, and CSS custom properties (--var) all minify safely. Selector lists with commas are kept; only insignificant whitespace is collapsed.

Can I beautify a one-line minified bundle?

That's exactly what Beautify is for. Paste any minified JS or CSS, hit Beautify, get a re-indented version. The beautifier doesn't change semantics — it just adds newlines and indentation based on bracket depth. Works on any valid input regardless of how it was minified.

Is anything sent to your server?

No. The tokeniser, minifier, and beautifier all run in JavaScript on your device. Open DevTools → Network and you'll see zero outbound requests during minify or beautify. Paste API keys, secrets, or proprietary code — nothing leaves your laptop.