Code Minifier
Minify CSS, JavaScript, HTML or JSON in the browser: strip comments and whitespace, see the size saved instantly.
Result
This code minifier compresses CSS, JavaScript, HTML and JSON by stripping everything the machine does not need: comments, indentation, newlines and redundant whitespace. Pick the language, paste the source, press the button — the result panel shows the minified code together with exact before/after sizes in bytes and the percentage saved.
The minification is deliberately conservative and safe. For JavaScript that means comments and whitespace only — no variable renaming, no expression rewriting — with a scanner that correctly walks strings, template literals and regex literals, and preserves newlines wherever automatic semicolon insertion could change behavior. CSS gets whitespace merged around braces, colons, semicolons and commas; HTML gets inter-tag whitespace collapsed while pre, textarea, script and style content stays untouched; JSON is parsed and re-serialized, which validates it at the same time.
Everything runs locally in your browser: no source code is uploaded to any server, which makes the tool safe for proprietary, unreleased or client code. There is no sign-up, no file-size ceiling beyond your browser's memory, and the result is one click away from the clipboard or a downloaded file.
Minification is the opposite of formatting: this tool makes code smaller for production, while our code formatter makes minified code readable again. Use the minifier for inline scripts and styles, email HTML, API payloads and any place where a full build pipeline with Terser or cssnano would be overkill for a quick one-off job.