โœ‚๏ธ JavaScript / CSS Minifier

Removes comments and unnecessary whitespace to reduce file size. CSS is fully compressed onto one line; JS safely removes only whitespace and comments, without changing variable names.

How to use

  1. Choose CSS or JavaScript.
  2. Enter your code.
  3. Click "Minify" to see the result with comments/whitespace removed and the size reduction shown.

๐ŸŽฏ Use Cases

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.

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.

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