How to use
- Choose CSS or JavaScript.
- Enter your code.
- Click "Minify" to see the result with comments/whitespace removed and the size reduction shown.
🎯 Use Cases
- Reduce CSS/JS file size before deployment
- Minify inline styles for email templates, etc.
- Minimize size when sharing code
Example
Input
.button {
color: #ffffff; /* text color */
background: #3366ff;
padding: 10px 20px;
}Output
.button{color:#ffffff;background:#3366ff;padding:10px 20px}In CSS mode the tool strips comments and all unnecessary whitespace and line breaks, drops the trailing semicolon, and collapses everything onto one line. This example shrinks from 93 to 59 bytes, about 37% smaller.
What gets removed vs kept
Comments and unnecessary whitespace are stripped to cut size. CSS compresses to one line; JS only removes what is safe.
| Target | Processing |
|---|---|
| CSS | All comments, spaces and newlines removed — one line |
| JS | Only comments and redundant whitespace — names and strings kept |
| Not done | Name mangling and dead-code removal — not a Terser-level optimizer |
| Caution | Check the output for edge cases like regex literals |
FAQ
- Are variable names mangled too?
- No. For safety, only comments and unnecessary whitespace are removed — variable names are left unchanged. For actual production deployments, we recommend using a dedicated bundler.
- Do CSS and JS minify differently?
- CSS is fully compressed onto a single line, while JS keeps line breaks for syntactic safety and only removes whitespace and comments.
- Is the code I enter sent to a server?
- No. It's processed entirely in your browser.
- Are JS variable names shortened?
- No — only whitespace and comments are removed. Name mangling is a bundler feature (Terser, esbuild).
- Does minified code still work?
- Whitespace removal does not change behavior. For rare code relying on ASI, verify the output.
More Coding Tools
📘
JSON Formatter
Prettify, validate & minify JSON
🗓️
Timestamp Converter
Convert Unix timestamp ↔ date
🧩
JSON String Encoder
Convert text ↔ JSON string literal
✨
JS/CSS Formatter
Indent & tidy JS/CSS code
🧽
HTML Formatter
Indent HTML by tag structure
🧹
XML Formatter
Indent XML by tag structure
🗃️
SQL Formatter
Break SQL into clauses & indent
🔣
HTML Entity Encoder
Convert special chars ↔ HTML entities
📊
Excel to HTML Table
Convert spreadsheet data to HTML TABLE
⛓️
Link Extractor
Extract href/src links from HTML
🎨
Color Picker
Get HEX, RGB & HSL color codes
🐘
PHP Syntax Checker
Check bracket/string pairing (practical checker)
🗄️
MySQL Syntax Checker
Check bracket/quote pairing (practical checker)
🔍
HTML5 Validator
Check tag pairing, duplicate id, missing alt
✍️
Online HTML Editor
Write & edit HTML visually