Inspect compressed CSS
Expand a short stylesheet to distinguish selectors, properties and values before changing a declaration. Retain project sources to recover original files and build comments.
Reindent a CSS stylesheet for easier review, or minify it to produce more compact code, directly in your browser.
This input could not be processed. Check its syntax and the limitations explained below.
Make a stylesheet easier to inspect or produce a compact version of a CSS excerpt. Both actions parse syntax instead of blindly deleting spaces and comments. A string containing semicolons, a URL or a calc() expression must remain a coherent CSS value. Results are displayed as text: rules are never applied to this page, and resources mentioned in url() or @import are not downloaded for processing.
Formatting uses structured CSS layout with two-space indentation. Recognized blocks, declaration lists and nested rules are rewritten for readability. Class names, identifiers and custom properties are not renamed to shorten the document.
Compact mode generates output from the CSS syntax tree. It removes unnecessary separators while retaining grammatical ones, including spacing around operators in calc(). Text values are not split into declarations simply because a quoted string contains : or ;.
Compact mode removes ordinary comments. Comments beginning with ! or containing @license or @preserve are retained and collected at the start of the output. If a comment instructs a particular build system, inspect the result: this tool does not interpret every bundler or preprocessor convention.
Parsing is not a certification of properties or rendering. Unknown properties, unsupported values and ineffective rules may still appear in well-formed CSS. This form targets CSS, not Sass/SCSS or Less compilation. It does not match selectors against your DOM or calculate which styles actually apply.
Paste rules or import a .css file. Remove <style> tags from HTML snippets: this form expects stylesheet content rather than a complete page.
Format for review or use compact output to shorten the text. If parsing fails, check strings, parentheses, comments and braces.
Review URLs, calculated expressions and retained comments before copying or downloading. New input hides old output; reset clears both fields.
Expand a short stylesheet to distinguish selectors, properties and values before changing a declaration. Retain project sources to recover original files and build comments.
Present readable rules in a review or issue. Formatted CSS does not include the HTML elements needed to reproduce the behavior.
Reduce layout whitespace in stable CSS. This neither removes unused rules nor replaces network compression.
The a selector and color keep their roles. Formatting places the declaration on its own line with two-space indentation.
Input
a { color: red; }Result
a {
color: red;
}
The text a; b: { } remains one string. The subtraction in calc(100% - 2px) retains the necessary separators around its operator.
Input
a { content: "a; b: { }"; width: calc(100% - 2px); }Result
a{content:"a; b: { }";width:calc(100% - 2px)}Some spaces separate tokens required by CSS grammar. Removing them from calc(100% - 2px), for example, can make an expression invalid. Compact does not mean removing every space.
Comments marked with !, @license or @preserve are kept at the start. Other comments are removed. Check special directives used by your build system.
This tool’s contract is CSS. It does not resolve preprocessor variables or execute their functions. Compile your source with the appropriate software before preparing compact CSS.
No. Readable syntax guarantees neither property support nor an effect in a particular DOM. Test target browsers and different interface states separately.
Related tools
Tools similar or complementary to this one.
Format HTML or remove ordinary comments locally while retaining text whitespace and script content. No page execution or upload is required.
Format JavaScript, TypeScript or JSX for easier reading without executing code. Processing runs locally in your browser.
Encode or decode common HTML entities to convert special characters in text.
Understand ISO 8601 week numbers, Unix timestamps in seconds or milliseconds, and the difference between human-readable dates and technical time values.