snaptools
C
CSS Minifier error
⌃⏎ run · clear · / focus input
// about this tool

CSS Minifier Online

Updated 2026-07-09

Minify and compress CSS online for free. Paste your stylesheet and SnapTools strips comments, line breaks, and redundant whitespace to produce the smallest equivalent CSS — ready to copy or download for production. Everything runs in your browser, so your stylesheet is never uploaded.

Every byte of CSS your visitors download costs load time. Minifying removes only the characters browsers ignore, so the page renders exactly the same while the file gets smaller. Edit in readable form, then minify here as the last step before you ship — or run the output back through the CSS Formatter when you need to work on it again.

// how to use

  1. 1 Paste your CSS into the input panel on the left.
  2. 2 SnapTools strips comments and unnecessary whitespace as you type.
  3. 3 Copy or download the minified stylesheet for production.

// examples

Readable CSS to minified
Input
body {
    margin: 0;
    /* base font */
    font: 14px/1.5 sans-serif;
}
Output
body{margin:0;font:14px/1.5 sans-serif}
Multiple rules compressed
Input
.a { color: red; }
.b { color: blue; }
Output
.a{color:red}.b{color:blue}

// common uses

Shrinking a stylesheet before deploying to production Reducing page weight for faster load times Inlining compact CSS into an HTML template Quick size comparison before and after compression

// faq

No. Minification runs entirely in your browser, so your stylesheet never leaves your machine.
Comments, line breaks, indentation, and other non-significant whitespace are removed, and the last semicolon in each block is dropped. Selectors, properties, and values are preserved.
No. Only characters that browsers ignore are removed, so the rendered result is byte-for-byte equivalent in behaviour — just smaller.
It depends on how much whitespace and commentary the source contains, but typical hand-written CSS shrinks noticeably, which means fewer bytes to download and faster page loads.
Minifying is one-way, but you can run the output through the CSS Formatter to restore readable indentation whenever you need to edit it.

Use this via API

Get a free API key →
curl -X POST https://snaptools.dev/api/v1/tools/css-minifier \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"body { margin: 0; /* base font */ font: 14px/1.5 sans-serif; }"}'
Esc
↑↓ navigate open Esc close