CSS & JS Minifier
Minify CSS and JavaScript to load pages faster.
How to use
- 1Choose CSS or JavaScript.
- 2Paste your code or open a file.
- 3Click “Minify”. For JavaScript you can also shorten variable names.
- 4Copy or download the minified code and see how much smaller it is.
Frequently asked questions
What does minifying do?
It removes spaces, comments and line breaks and shortens code where safe, so files download faster without changing how they work.
Which engines are used?
JavaScript is minified with Terser and CSS with CSSO, the same tools used by many build systems. They load only when you click Minify.
What does “Shorten variable names” do?
It renames local variables to short names like a and b (mangling). It's safe for normal code; turn it off if other scripts rely on your function or variable names.
What if my code has an error?
You'll see the error message with its line and column so you can fix it.
Is my code uploaded?
No. Minification runs entirely in your browser.
You may also need
XML Formatter
Beautify, validate or minify XML.
SQL Formatter
Format SQL queries for any database.
YAML ⇄ JSON Converter
Convert YAML to JSON and back.
JSON to TypeScript
Generate TypeScript interfaces from JSON.
HTML Entity Encoder
Escape and unescape HTML entities.
Number Base Converter
Binary, octal, decimal, hex and any base.