# CSS Formatter

> Reformat stylesheets with one declaration per line, consistent indentation, and media-query nesting preserved. Comments stay in place; runs privately in your browser.

[bfotkit](/) Runs in your browserCategories ▾[All tools 307](/en/tools/)[Text tools9](/en/tools/text-tools/)[Image tools27](/en/tools/image-tools/)[PDF tools20](/en/tools/pdf-tools/)[Social media tools97](/en/tools/social-media-tools/)[Security tools8](/en/tools/security-tools/)[Coding tools25](/en/tools/coding-tools/)[CSS tools12](/en/tools/css-tools/)[Color tools6](/en/tools/color-tools/)[Miscellaneous tools103](/en/tools/miscellaneous-tools/)

[All tools ↗](/en/tools/)[EN](/en/tools/css-formatter/)[PT](/pt-br/ferramentas/formatador-css/)[DE](/de/werkzeuge/css-formatierer/)[ID](/id/alat/pemformat-css/)[RU](/ru/instrumenty/formatirovshik-css/)

CODING & JSON · BFOTKIT

# CSS Formatter | BFOTKit

Reformat stylesheets so every selector, declaration, and closing brace sits on its own line with consistent indentation — including rules nested inside media queries.

InputIndent2 spaces4 spacesTab

Load sampleFormat

OutputCopyDownloadClear

All processing happens in this browser tab. Nothing is sent to a server.

GUIDE

## How to format CSS

### What the output looks like

Each rule becomes a selector line ending with an opening brace, one declaration per line, and a closing brace on its own line. Rules inside at-rules such as media queries indent one level deeper, so the structure of the file is visible at a glance.

### Comments are preserved

Comments in your stylesheet stay in place as their own lines, which keeps author notes, section markers, and license headers intact while the surrounding code is normalized.

### Choose indentation per project

Two spaces dominates modern CSS; four spaces survives in older teams; tabs are a valid accessibility-friendly choice. The goal is consistency with the rest of the codebase, not personal taste.

### Formatting does not validate

The formatter normalizes whitespace and line structure but does not check syntax. A missing semicolon or an unbalanced brace will still be there — but the one-rule-per-line layout usually makes such mistakes easy to find by eye.

HELP / FAQ

## CSS formatter questions

### Does it reorder or merge rules?

Never. Declarations keep their original order inside each rule, and rules keep their position in the file, because CSS cascade order is part of the meaning.

### Will it handle minified one-line CSS?

Yes. A minified file is exactly the messy input this formatter is built for: it re-splits rules and declarations into readable lines.

### What about at-rules like keyframes?

At-rules are formatted like regular blocks: the header line, indented declarations or nested rules, and a closing brace. Keyframe steps format as nested rules one level deeper.

### Is my stylesheet uploaded?

No. Everything runs in this browser tab and the download is local.

EXPLORE BY CATEGORY · BFOTKIT

## More tools like this

Pick a category to see every tool in it — then open one and discover related tools.

[All tools 307](/en/tools/)[Text tools 9](/en/tools/text-tools/)[Image tools 27](/en/tools/image-tools/)[PDF tools 20](/en/tools/pdf-tools/)[Social media tools 97](/en/tools/social-media-tools/)[Security tools 8](/en/tools/security-tools/)[Coding tools 25](/en/tools/coding-tools/)[CSS tools 12](/en/tools/css-tools/)[Color tools 6](/en/tools/color-tools/)[Miscellaneous tools 103](/en/tools/miscellaneous-tools/)

[Coding toolsPrivate JSON formatter and text cleanup tools↗](/en/tools/private-json-text-cleanup/)[Coding toolsURL Slug Generator↗](/en/tools/url-slug-generator/)[Coding toolsBase64 Encoder/Decoder↗](/en/tools/base64-encoder-decoder/)[Coding toolsURL Encoder/Decoder↗](/en/tools/url-encoder-decoder/)[Coding toolsHTML Encoder/Decoder↗](/en/tools/html-encoder-decoder/)[Coding toolsHAR Sanitizer↗](/en/tools/har-sanitizer/)[Coding toolsJSON Formatter↗](/en/tools/json-formatter/)[Coding toolsJSON Validator↗](/en/tools/json-validator/)

[Browse all tools →](/en/tools/)

[bfotkit](/)[All tools](/en/tools/)[Privacy Policy](/en/privacy-policy/)[Terms & Conditions](/en/terms-and-conditions/)[About Us](/en/about-us/)[Contact Us](/en/contact-us/)

Useful tools. No fuss. © 2026 BFOTKit[bfotkit.com ↗](https://bfotkit.com/)
