online minifier

How to use the online minifier

  1. Paste CSS, JavaScript, or HTML in the editor — the tool auto-detects the language.
  2. The minified output appears on the right with the byte count and percentage saved.
  3. For JavaScript, Terser-level minification applies: mangle variable names, drop console logs, evaluate constants.
  4. Copy the output or download as a .min file.

When to use it

Minify only when your build tool isn't already doing it — Vite, Webpack, esbuild, and Next.js all minify production output automatically. This tool is useful for inline scripts, one-off stylesheets, or environments without a build step (static HTML landing pages, WordPress blocks). Alternative: terser/cssnano via your build pipeline is the right answer for any project with a package.json.

Frequently asked questions

Will minification break my code?
For CSS and HTML, effectively no — whitespace and comments are safe to remove. For JavaScript, mangling can break code that relies on Function.prototype.name or toString() output, or that uses global implicit references.
Can I un-minify code?
Not exactly — minifiers are lossy because they rename variables. A pretty-print tool can reformat and re-indent the code, but the original variable names are gone.
How much does minification save?
CSS typically 10-25%. JavaScript typically 30-50%. Gzip on top brings additional savings — for production, most of the wire-size win comes from gzip, not minification alone.
What's the difference between minify and compress?
Minify = transform the source (remove whitespace, mangle names). Compress = byte-level encoding (gzip, brotli). Stack both: minify at build time, compress in the HTTP response layer.

Related tools

Last updated: 2026-04-22