freetools.guru

CSS Minifier

Minify, format and check CSS code instantly in your browser. A parser-based engine removes comments and unnecessary whitespace safely, preserves /*! license banners, custom properties, calc() and vendor fallbacks, and reports size savings. Private, no uploads.

Paste CSS to get started

Options

Indentation affects Format CSS. Remove Comments and Preserve /*! comments affect Minify CSS. Strings, URLs, data URIs, custom properties and calc() are never altered.

Your CSS is processed locally in your browser and is never uploaded. Minification is safe and conservative: fallback declarations and vendor-prefixed properties are preserved. The tool never applies your CSS to this page and never downloads url() or @import resources.

How it works

  1. 1Paste your CSS. Paste any stylesheet — custom properties, calc(), @media, @supports, @keyframes, @font-face or modern nested CSS — into the input. Up to 2,000,000 characters are supported.
  2. 2Minify, format or check. Click Minify CSS (or press Ctrl+Enter) to shrink the stylesheet, Format CSS to beautify it with 2-space, 4-space or tab indentation, or Check CSS for a parser-based syntax check that reports issues with line and column.
  3. 3Review the savings. Check the statistics — original and output characters and UTF-8 byte sizes, characters and bytes saved, and the reduction percentage — after every minify or format run.
  4. 4Copy or download. Copy the minified output, download it as styles.min.css (or styles.css after formatting), or move the result back into the input for another pass — all locally in your browser.

Best practices

  • Keep your original stylesheet — minified CSS is hard to edit by hand, so the readable version is your source of truth.
  • Enable Preserve /*! comments for files that ship with open-source licenses or copyright notices, then always double-check the banner survives in the output.
  • Minification here is conservative: fallback declarations and vendor-prefixed properties are preserved so layout behavior never changes — always re-test the minified file in a real browser.
  • The tool minifies text only — it never downloads @import or url() resources, and it never applies your CSS to the page you are viewing.
  • Everything runs locally in your browser — nothing is uploaded.

Frequently Asked Questions

What does the CSS Minifier do?
It shrinks stylesheets by removing comments and unnecessary whitespace while preserving behavior. Paste your CSS and click Minify CSS — strings, URLs, data URIs, custom properties, calc() and vendor fallback declarations are never corrupted, and you can copy or download the result. Everything runs locally in your browser.
Can it beautify CSS?
Yes. Click Format CSS to turn minified or messy CSS into clean, consistently indented code with 2-space, 4-space or tab indentation. Formatting is parser-based, so selectors, at-rules and values are preserved exactly.
Does it remove comments?
Yes — Remove Comments is on by default. License banners that start with /*! are kept by default so you stay compliant when shipping minified stylesheets; turn off Preserve /*! comments to drop them too. Unchecking Remove Comments keeps every comment.
Does it support CSS variables and calc()?
Yes. Custom properties (--name), var(--name, fallback), and modern functions such as calc(), min(), max() and clamp() are preserved exactly — including the spaces calc(100% - 20px) needs to stay valid.
Does it support @media, @supports and @keyframes?
Yes. At-rules including @media, @supports, @keyframes (with vendor prefixes), @font-face, @import, @property, @container, @layer, @scope and @starting-style are parsed and minified without corruption. Modern nested CSS is preserved too.
Does it download @import or url() resources?
No. The tool never fetches anything. @import rules and url() references are preserved as text — including data URIs and base64 SVGs — but no network request is ever made.
Is CSS minification risky?
Minification removes only what is never needed — comments, whitespace, optional final semicolons, and safe value shortenings such as #ffffff to #fff and 0px to 0. Fallback declarations (display: -webkit-box; display: flex) and vendor-prefixed properties are always preserved, and the tool never merges declarations away.
Can the CSS Minifier validate my stylesheet?
Click Check CSS for a parser-based syntax check. It reports No parser errors found or lists the issues found with line and column, so you can fix the source. This is a syntax check, not a full W3C standards validation.
Is my CSS uploaded to a server?
No. Your CSS is processed locally in your browser and is never uploaded anywhere. No account is required, no network request is made, and the tool never applies your CSS to the page you are viewing.

Related Tools

Supported CSS

Minify any modern CSS directly in your browser: selectors (including attribute, pseudo-class, pseudo-element, custom elements and escaped selectors), strings, quoted and unquoted URLs, data URIs and base64 SVGs, custom properties, var() with fallbacks, calc()/min()/max()/clamp(), and at-rules such as @media, @supports, @keyframes (with vendor prefixes), @font-face, @import, @property, @container, @layer, @scope and @starting-style. Modern nested CSS (&:hover) is preserved with a nesting-aware engine. Unicode text (Tamil, Hindi, Arabic, CJK and emoji) is preserved exactly. Up to 2,000,000 characters per input. Everything runs locally — no uploads.

Privacy & data removal

Your CSS is minified, formatted and checked entirely in your browser and is never uploaded to any server. No account is required to use the CSS Minifier, we never store or share your stylesheets, and the tool makes no network requests — @import and url() resources are never fetched.