Developer tools

CSS Minifier

Minify CSS to shrink file size and speed up rendering. Strip comments and whitespace, collapse safe shorthands, shorten colors, and see exactly how many bytes you saved.

Free online CSS compressor. Processing stays in your browser; nothing is uploaded.

Options

Original

392 B

Minified

231 B

Saved

161 B

Reduction

41.1%

What Is a CSS Minifier?

A CSS minifier compresses stylesheets by stripping comments, collapsing whitespace, shortening color and zero values, and tightening safe shorthands. Smaller CSS means faster downloads for render-blocking stylesheets—especially when stacked with gzip or Brotli on the server.

This free online CSS compressor runs in your browser. Paste CSS, choose options, and copy the minified output with an exact before-and-after byte report. Declarations with !important are preserved.

Online Minify vs cssnano, clean-css, and PostCSS

Production pipelines often use PostCSS with cssnano, clean-css, or Lightning CSS for deeper optimizations, source maps, and unused-CSS removal. This page is for quick compress-and-check workflows without installing a package—then mirror the same habits in CI.

Critical CSS extraction and unused selector purging are separate steps. Minify the CSS you ship; extract above-the-fold CSS and drop dead rules in the build for the largest Core Web Vitals wins.

What This CSS Minifier Does

  • Comment stripping
  • Whitespace removal around selectors and declarations
  • Hex color shortening (#ffffff → #fff)
  • Zero-value shortening (0px → 0, 0.5 → .5)
  • Margin/padding shorthand collapsing when equal sides match
  • Trailing semicolon removal before closing braces
  • !important preservation and string/url safety
  • Exact file size reduction report in bytes

CSS Minifier FAQs

What is a CSS minifier?

A CSS minifier (or CSS compressor) removes comments and unnecessary whitespace, shortens color values, and collapses safe shorthands so stylesheets download faster while keeping the same rendered result—including !important declarations.

Is CSS minification the same as gzip or Brotli?

No. Minification shrinks the CSS source itself. Gzip and Brotli are transfer encodings. Use both: minify with a CSS minify tool (or cssnano / clean-css / PostCSS in your build), then serve with compression. That reduces render-blocking CSS weight.

Does this collapse shorthand and shorten colors?

Yes. Optional passes shorten #rrggbb to #rgb when safe, trim zero units (0px → 0), and collapse margin/padding values like 16px 16px 16px 16px → 16px. Aggressive unused-CSS removal and full cssnano pipelines belong in your build.

Will !important be preserved?

Yes. The minifier keeps !important on declarations. It does not rewrite selectors or remove rules, so specificity and intentional overrides stay intact.

What about critical CSS and unused CSS?

This tool compresses the CSS you paste; it does not extract critical CSS or purge unused selectors. Pair minification with critical-CSS extraction and unused-CSS removal (PurgeCSS, Lightning CSS, etc.) in production builds for the largest gains.

Can I use source maps with minified CSS?

Online paste tools do not emit source maps. In CI, use PostCSS, cssnano, or clean-css with sourceMap: true so DevTools can map minified lines back to your authoring files.

Is this a free online CSS minifier?

Yes. Paste CSS, review the byte savings report, and copy the result. Processing stays in your browser—nothing is uploaded to LiveTechHacks.

Related Developer & SEO Tools

Other LiveTechHacks utilities that also run in your browser.

JWT Decoder

Decode JWT tokens instantly and inspect the header, payload, claims, signature details, and expiration time in a readable format.

Open Tool

Slug Generator

Turn any title or phrase into a clean, SEO-friendly URL slug. Accents, symbols, and optional stop words are handled locally in your browser.

Open Tool

Passphrase Generator

Generate strong, memorable passphrases from the EFF diceware wordlist. Pick your word count and separator. Runs offline — nothing is ever transmitted.

Open Tool

Cron Expression Generator

Build cron expressions visually and preview the next run times instantly. Supports standard crontab, Quartz, Spring and AWS syntax. Free, with no sign-up.

Open Tool

YAML ↔ JSON Converter

Convert YAML to JSON and JSON to YAML instantly, with validation and error highlighting. Works with Kubernetes, OpenAPI and Docker Compose files.

Open Tool

UUID Generator

Generate random UUID v4, v1 and v7 identifiers in bulk, up to 1,000 at a time. Copy or download instantly in your browser.

Open Tool

Epoch Converter

Convert Unix timestamps to readable dates and back, in seconds or milliseconds. Live clock, timezones, and code snippets.

Open Tool

Base64 Encoder & Decoder

Encode and decode Base64 strings, files and images instantly. Supports base64url and data URIs in your browser.

Open Tool

Hex to RGB Converter

Convert hex colour codes to RGB, RGBA, HSL and CMYK instantly with a live preview swatch and code snippets.

Open Tool

CSV ↔ JSON Converter

Convert CSV to JSON and JSON to CSV instantly. Custom delimiters, headers, quoted fields, and nested object flattening.

Open Tool

HTML Minifier

Minify HTML to cut page weight. Strip comments, collapse whitespace, and review before-and-after size — free in your browser.

Open Tool

Case Converter

Convert text between uppercase, lowercase, sentence case, title case, camelCase, and snake_case. Supports AP and Chicago title style.

Open Tool

JSON Formatter & Validator

Format, validate and beautify JSON with a collapsible tree view and line/column error reporting. Free, private, no sign-up.

Open Tool

Markdown to HTML Converter

Convert Markdown to clean HTML with a live side-by-side preview. Supports GFM, tables, and code highlighting.

Open Tool

XML Formatter Online

Format, indent and validate XML with error highlighting and a collapsible tree view. Works with SOAP, RSS, and sitemaps.

Open Tool

Diff Checker

Compare text or code side by side with line and character highlighting. Ignore whitespace or case. Free and private.

Open Tool

Binary to Decimal Converter

Convert between binary, decimal, hex, and octal with step-by-step working. Supports signed values and bit widths.

Open Tool

Regex Tester

Test regular expressions live with match highlighting, capture groups, and plain-English explanations.

Open Tool

ASCII Table

Complete ASCII chart with decimal, hex, binary, and octal values—plus extended ASCII. Searchable and printable.

Open Tool