About this tool
Minification is the cheapest performance win on the web: source files written for humans carry comments, indentation and blank lines that browsers must download but never use. This tool removes them with a string-aware scanner — it knows when it is inside a quoted string, a template literal or a regular expression, and never trims there. Semicolons and significant spaces are kept; what disappears is only what the language never needed.
The honest boundary: this is a whitespace-and-comments minifier, not an obfuscator or a bundler. It will not shorten variable names or merge files, so expect solid savings (comments and layout are often a third of a hand-written file) rather than the extreme ratios of a full build pipeline. For a snippet, a single file, or a site without a build step, that is precisely the useful trade.
How to use it
- Choose JavaScript or CSS.
- Paste the code.
- Press Minify; check the size report, then copy the result.
Good to know
- Keep your unminified original as the source you edit — minified output is a delivery format, not a working format.
- Test after minifying, as with any optimisation: one page load tells you the behaviour survived.
- CSS savings compound across every page of a site, since the stylesheet downloads once and caches.
Frequently asked questions
Is string-aware minifying really necessary?
Yes. A naive remover breaks code the moment a string contains // or a space pattern it dislikes. This scanner tracks strings, templates and regexes and leaves their contents alone.
Does it rename variables for extra savings?
No — renaming is a compiler's job and can break code that relies on names. This tool sticks to whitespace and comments.
Is my code sent to a server?
No. Everything happens in your browser.
More Developer tools
JSON Formatter & Validator
Pretty-print messy JSON, minify it back, and get a precise error location when it will not parse.
JSON to CSV
Turn a JSON array of objects into a clean spreadsheet-ready CSV, columns and escaping handled.
CSV to JSON
Convert spreadsheet CSV into a JSON array — quoted fields, embedded commas and all.
XML Formatter
Indent and validate XML — sitemaps, feeds, config files — with errors pointed at the guilty tag.
JS / CSS / HTML Beautifier
Untangle minified or messy code into readable, consistently indented JavaScript, CSS or HTML.
Regex Tester
Test a regular expression against your text live — every match highlighted, groups shown.
Making videos too? Try our YouTube SEO Checker, or browse the full Toolkit and the free YouTube tools.