CSS Formatter / Minifier
How to use
Prettifies CSS (and basic SCSS/LESS) with consistent indentation and line breaks, or minifies it into a compact single line. Paste your stylesheet, pick Format or Minify, and copy the result straight into your project.
Result will appear here...- Un-minifying a production stylesheet to debug a layout issue
- Cleaning up inconsistent spacing in a SCSS snippet copied from a tutorial
- Minifying CSS before shipping it to reduce page weight
- Standardizing indentation across stylesheets contributed by different developers
What formatting can safely change, and what it must not
Formatting CSS is a whitespace transformation, with one important exception: order within a rule is meaningful. Later declarations override earlier ones of the same property, so a formatter that sorted properties alphabetically would silently change which value wins. This tool reorders nothing. It normalises indentation, spacing around braces and colons, and line breaks between rules: the things that make a stylesheet readable without altering what the browser computes.
Minification is the same transformation aimed the other way: strip every byte that does not change behaviour. Whitespace between tokens goes, the last semicolon in a block goes, comments go. What must survive is anything inside a string or a url() (whitespace there is data, not formatting) and any comment marked as legally required. Over-aggressive minification that ignores those cases produces a stylesheet that is smaller and broken, usually in a way that only shows up on one page.
Because formatting requires parsing, the formatter doubles as a syntax check. A missing closing brace, an unterminated string or a stray character typically produces output that stops or goes visibly wrong at the point of the problem, which is often faster than hunting for it by eye. What it cannot tell you is whether a property name is real or a value is valid for it: `colour: red` is syntactically perfect CSS and does nothing at all. For that, a linter such as stylelint is the right tool; this one answers the structural question.
Free and private. Everything runs on your own device, with no account and no uploads.
A stylesheet minified for production is unreadable when you need to debug it, and a hand-written SCSS snippet copied from a tutorial often has inconsistent spacing. This tool formats CSS, plus basic SCSS and LESS syntax, into a clean, consistently indented layout, or minifies it into a compact single line to reduce file size before shipping to production.
Basic SCSS and LESS syntax is handled for formatting purposes, but this is a lightweight formatter, not a full preprocessor, it will not compile nested SCSS into plain CSS.
Minification only removes whitespace and comments, so valid CSS should continue to work identically, but always test after minifying production stylesheets.
No, it preserves your original property order and only adjusts indentation and line breaks.
It is focused on formatting rather than strict validation, so some malformed CSS may still be reformatted without an explicit error.
- 1
Paste your stylesheet
Add CSS, SCSS or LESS code into the input area.
- 2
Choose Format or Minify
Pick readable formatting or compact minification.
- 3
Review the output
Check that rules, selectors and properties are laid out correctly.
- 4
Copy the styles
Copy the result straight into your stylesheet or build process.
- ·This is a lightweight formatter, not a preprocessor, it will not compile nested SCSS or resolve mixins into plain CSS.
- ·Property order is preserved exactly as written, so use a separate linter if you want properties sorted alphabetically.
- ·Always spot-test a minified stylesheet in the browser afterward, even though minification should not change behavior.