مصغّر CSS
صغّر CSS بإزالة التعليقات والمسافات البيضاء في متصفحك. مجاني، عبر الإنترنت، بدون رفع، خاص تماماً.
Local processingWhat is مصغّر CSS?
A CSS minifier compresses a stylesheet by removing comments, whitespace, and redundant characters (trailing semicolons, zero-unit values) without changing its selector-matching or rendering behavior. Minified CSS ships fewer bytes over the network, improving page load time and Core Web Vitals. The tool runs in the browser, so proprietary stylesheets are never uploaded.
How It Works
The minifier tokenizes the CSS source (selectors, declarations, at-rules) and re-emits a compact form: comments are dropped, whitespace between tokens is removed where unambiguous, trailing semicolons in declaration blocks are omitted, and the last semicolon before a closing brace is stripped. Some minifiers shorten hex colors (#ffffff → #fff) and drop leading zeros (0.5 → .5). The output is semantically identical to the input.
Common Use Cases
- Preparing production stylesheets — minify before deploy to cut payload size
- Inlining critical CSS — compress above-the-fold styles for a fast first paint
- Optimizing email templates — shrink CSS to fit tight size limits
- Reducing bundle size — minify concatenated CSS before serving
Technical Details
Approach: token-based minification (not a full AST rewrite). Removed: comments, unnecessary whitespace, trailing semicolons, empty rules. Preserved: selector specificity, declaration order, media queries, vendor prefixes. Typical reduction: 20-40% depending on comment and whitespace density. The minifier does not rename class names (that requires build-time HTML coordination). Output is valid CSS.
How to Use
Enter your input above. The result updates automatically. Use the copy button to copy the result.
Privacy
All processing happens in your browser. Your data is never uploaded to any server.
FAQ
Is my CSS uploaded?
No. Minification happens locally in your browser. Your code never leaves your device.
How much size reduction can I expect?
Typically 20-40% depending on the amount of comments and whitespace in your CSS.
Does minification change how my CSS behaves?
No. The minifier only removes comments, whitespace, trailing semicolons, and empty rules — all of which are non-functional. Selector specificity, declaration order, media queries, and vendor prefixes are preserved. The output renders identically to the input.