Code Minifier

Minify JavaScript, CSS or HTML — comments and whitespace stripped, bytes saved reported.

Minify JavaScript, CSS or HTML online: comments and whitespace stripped, byte savings reported. Auto-detect picks the language; CSS is minified aggressively, JS conservatively so string literals stay intact. Everything runs in your browser.

Original: 0 bytes Minified: 0 bytes Saved: 0%

How to use the Code Minifier

  1. Paste your code and pick the language (or leave it on auto-detect).
  2. Hit Minify — the output plus bytes-saved stats appear instantly.
  3. Copy the minified output into your production bundle.

Frequently asked questions

How do I minify JavaScript online?

Paste the code above and hit Minify. The tool strips comments and collapses whitespace outside string literals, keeping your code safe to run.

Does the minifier rename variables?

No — it performs safe minification only (comments and whitespace). For full minification with renaming, use a build tool like esbuild or terser.

How do I minify CSS?

Paste CSS and choose CSS — comments are removed and whitespace around braces, colons and semicolons is collapsed.

Does HTML minification break <pre> blocks?

No — pre, textarea, script and style blocks are protected, so their content keeps its original formatting.