{{ summaryTitle }}
{{ summaryValue }}

{{ summaryLine }}

{{ badge.label }} {{ badge.value }}
{{ summaryAnnouncement }}
CSS minification inputs
Paste, drop, or browse one stylesheet. Output updates locally after each edit.
{{ sourceActionHint }}
Choose the rewrite boundary before using the generated stylesheet.
This target controls conservative value rewriting and audit language; it is not a compatibility test.
The default preserves protected comments and removes ordinary author notes.
Preserve is neutral. Normalize simple quoted values only after confirming the final CSS location.
The generated map records the original source but contains no token-level mappings.
Standard is neutral. Strict adds audit findings only.
{{ exportAnnouncement }}
{{ computation.values.minified_css }}
{{ exportAnnouncement }}

The chart renderer is unavailable. Exact byte values remain in the transformation ledger.

CheckStatusEvidenceNext stepCopy
{{ row.check }}{{ row.status }}{{ row.evidence }}{{ row.next_step }}
{{ exportAnnouncement }}
StageCountEffectReview noteCopy
{{ row.stage }}{{ row.count }}{{ row.effect }}{{ row.review }}
{{ exportAnnouncement }}

Introduction

Readable CSS contains indentation, line breaks, comments, and deliberately expanded values. Those choices help people review a stylesheet, but most of them are not needed by the browser. Minification removes dispensable text and shortens selected values so the same rules take fewer UTF-8 bytes.

The hard part is preserving token boundaries and cascade behavior. A space may be optional beside a brace but necessary between two names. Text inside quotes must remain text. Removing an earlier declaration may change support for older browsers even when a later declaration uses the same property. Relative asset paths still depend on where the final stylesheet is published.

Common CSS minification changes and their boundaries
ChangeTypical purposeBoundary to check
Whitespace removalDrop layout characters that do not separate tokens.Strings, escapes, operators, and identifier-like tokens still need valid boundaries.
Comment removalDiscard author notes from production text.Comments beginning with /*! often carry licenses or attribution.
Value shorteningTurn equivalent zeros and colors into shorter forms.Newer color syntax may not fit an older browser policy.
Duplicate cleanupRemove an earlier property or join adjacent identical selectors.Intentional fallbacks and cascade ordering require regression tests.

Minification and transport compression solve different problems. Minification changes the stylesheet text before release. Gzip or Brotli compresses that text while it travels over the network. A file can benefit from both, and a large raw percentage reduction does not predict the same percentage over gzip.

Nor is minification the same as optimization of a whole site. It does not find unused selectors, combine separate files, rebase asset URLs, inline imports, add browser fallbacks, or prove that the rendered page is unchanged. The minified stylesheet still needs the build, browser, and visual checks required by the project.

The safest release choice is the smallest rewrite boundary that meets the size goal. More aggressive cleanup can save additional bytes, but it also increases the amount of behavior that must be tested.

How to Use This Tool:

Choose how much rewriting is acceptable before treating the output as a release artifact.

  1. Paste, drop, or load one stylesheet of no more than 2 MiB into CSS source. Close any unfinished comment or string and balance braces, brackets, and parentheses when validation stops.
  2. Select a Minify profile. Whitespace only keeps the narrowest boundary, Safe production minify also shortens conservative values, and Aggressive cleanup additionally reviews simple duplicates and adjacent identical selectors.
  3. Set Comment handling and Browser target. Preserve protected comments unless the release policy explicitly allows their removal; use the browser target as a rewrite choice, not as proof of compatibility.
  4. Inspect the byte result and Release audit. If URL normalization, aggressive cleanup, imports, modern syntax, or an external source map is involved, test the copied stylesheet from its final location before publishing it.

Technical Details:

CSS is a token stream rather than ordinary prose. A conservative minifier therefore tracks quoted strings, escapes, comments, and delimiter depth while it removes whitespace. It preserves a separating space when adjoining characters could otherwise merge into a different token.

Transformation Core

CSS minification transformation stages
StageApplied ruleImportant limit
Structural scanReject unclosed strings or comments and unbalanced braces, brackets, or parentheses.This is a focused delimiter check, not a complete CSS conformance test.
CompactionRemove selected comments, compact retained comments, collapse whitespace, and drop the final semicolon before a closing brace.Quoted content remains untouched.
Value rewritingRemove eligible zero units, shorten repeated hex pairs, and convert valid comma-form RGB colors to hex.Modern mode may also emit eight-digit hex from eligible RGBA values.
URL normalizationRemove quotes only from simple url() values without spaces, quotes, parentheses, or backslashes.Relative paths are never rebased.
Aggressive cleanupWithin simple flat rules, keep the last repeated property and merge adjacent identical selectors.Fallback declarations and cascade assumptions can change.
Source-map handoffAppend a map reference and produce a version 3 map containing the original source.The map has an empty mappings field, so it is not token-level debugging data.

Formula Core

Size metrics count UTF-8 bytes in the pasted source and final stylesheet. The map file itself is not added to the output-byte figure, although its reference comment is.

Bsaved=BinputBoutput R=max(0,BsavedBinput×100)

If a 1,200-byte stylesheet becomes 780 bytes, 420 bytes were removed and the displayed reduction is 35.0%. When an added map reference makes the output larger than the input, saved bytes may be negative but the reduction percentage is shown as 0% rather than a negative saving.

Strict release review changes warning coverage only; it does not perform extra rewrites. Fair comparisons keep the same source, profile, comment policy, browser target, URL policy, and source-map choice.

Limitations and Privacy:

Stylesheet text is processed locally and is excluded from the share URL. A generated source map is different: it embeds the original CSS, so publishing or sharing that map can disclose comments, internal names, paths, and source that the minified file no longer shows.

  • Test the minified file in the actual browser support matrix; the selected target is not a compatibility engine.
  • Review @import dependencies separately because imported stylesheets are not included in this pass.
  • Run cascade and visual regression tests after aggressive duplicate cleanup.
  • Confirm license and attribution obligations before stripping protected comments.

References: