Code Minifier
Minify CSS, JavaScript, and HTML to shrink file size, in your browser.
Recommended next steps
Related tools
Encode text to HTML entities or decode entities back to text.
Format, validate, and beautify JSON, in your browser.
Test a regular expression against text and see matches and capture groups.
Frequently asked questions
No. Minification runs entirely in your browser using JavaScript — your code is never sent to a server, so it's safe to paste private or unreleased code.
JavaScript is compressed and mangled with Terser, CSS is optimized with CSSO (shortening colors, removing redundant rules, and collapsing whitespace), and HTML is handled by a conservative whitespace-and-comment stripper that leaves the contents of <pre>, <textarea>, <script>, and <style> untouched.
It shouldn't. Terser and CSSO preserve behaviour while removing only what's safe to remove. The HTML step is intentionally cautious — it strips comments and collapses insignificant whitespace but never rewrites your markup, so what the page renders stays the same.
Already-compact code has little to remove, and for very small snippets the saving can round to zero. The size figures are measured in UTF-8 bytes — the bytes that actually travel over the wire — so they reflect real transfer savings rather than character counts.
Last updated 2026-06-23.