CSS Formatter and Minifier
Format a CSS stylesheet or serialize its syntax tree with compact token spacing.
Loading tool…
How to use CSS Formatter and Minifier
Format a CSS stylesheet or serialize its syntax tree with compact token spacing. Formatting uses the CSS parser in standalone Prettier. Minify uses CSS-tree parsing and generation, without selector reordering, declaration removal or an aggressive optimization pass. Important /*! comments are preserved.
- Provide css stylesheet, indent spaces.
- Choose the supported mode and run the tool. Review its assumptions and any reported errors.
- Copy the result or download a separate output; reset to clear the current form.
Good to know
- 50,000 source characters;10 seconds to load the worker/libraries, then2 seconds to compute. The worker is terminated on success, failure or timeout.
- Output is untrusted source text: it is never executed or inserted into this page. No linked resources or source maps are fetched.
- Stylesheets only; no SCSS/Less compiler, imports, browser-support test or complete property-value validation. Unknown raw values may be preserved rather than understood.
- Formatting/minification can normalize quoting and token spelling. Retain the original for legacy comment hacks; comments without ! may be removed in Minify mode.
- Inputs are processed on this device and are not automatically saved or uploaded.
Common questions
Does this optimize my CSS cascade?
No. The compact mode removes unnecessary syntax spacing through a parser/printer. It retains rule and declaration order, including duplicate fallback declarations, and does not apply the stylesheet.
Does this change my original input?
No. The tool returns a separate result. Review that output before using it in another application.
Keep going with related tools
All developer →CSS Selector Specificity Analyzer
Calculate selector specificity tuples, including supported functional selector rules.
DeveloperCSS Custom Property Resolver
Resolve var() references, fallbacks and cycles in an explicit custom-property map.
ColorsCSS Gradient Generator
Generate a two-color linear-gradient declaration with validated colors, angle, and stop positions.
TextText Diff
Compare two texts line by line and download an easy-to-read difference report, entirely in your browser.
DeveloperCSS Local Image Asset Embedder
Embed exact selected local image bytes into parsed CSS url() references and download a separate stylesheet with source-range evidence.
DeveloperCSS Keyframe Timeline Builder
Build a typed transform and opacity timeline, then download actual CSS or a fixed standalone animation demonstration.