HTML / CSS Dev Tools

CSS formatterRead the rules before shipping

Format, minify and check in one editor, with the original and undo history available.

CSS formatter

Current content

Format and Minify process the current content; Check never rewrites code. Indentation applies to the next Format action. Rule navigation follows edits.

Ctrl/Cmd+Enter · Ctrl/Cmd+Z

Enter CSS and choose an action.

0 UTF-16 units

Rule navigation

These rules belong to the current content. Editing, formatting or minifying refreshes their positions; select a rule to jump to its current line and column.

The current content has no selectors or at-rules to list.

View original

Initial input: up to 200,000 UTF-16 units. Output and further processing of generated documents: up to 1,000,000 units. All inputs and outputs are limited to 1,000,000 UTF-8 bytes. CSS stays in this browser tab and is not uploaded. Undo history stays in this tab and is bounded for large documents.

A compressed stylesheet can hide a duplicate declaration or a media rule in one long line. If you need to format CSS online, this CSS formatter opens it up while keeping selector and declaration order intact, so you can inspect the cascade before changing it.

Use the CSS beautifier to read code, then minify CSS for a smaller handoff. This CSS formatter also serves as a structural CSS validator without rewriting code during checks. Every action uses the current content; Undo and the original view let you revisit earlier code.

Why this CSS formatter keeps the source visible

Keep processing the current code while rule locations stay in sync.

Formatting without a cascade rewrite

The CSS formatter keeps declarations and repeated properties in order, and readable formatting retains comments. Open the original to compare, or use Undo to return to earlier content.

Original CSS with closely packed selectors beside the same rules formatted across indented lines.

Navigate to the rule that needs attention

The rule list names selectors and at-rules in the current content. Formatting and minifying recalculate their positions, so selecting a rule or syntax error takes you to the current line and column.

CSS source with a nested media rule highlighted beside a list of rule markers and one error location.

Keep working on the current content

01

Load CSS and browse its rules

Paste code or load the example. Navigation updates without changing text and follows manual edits, Undo and Redo in the current editor.

02

Choose a deliberate action

Format uses 2 spaces by default; choose 4 spaces or tabs if needed. Indentation changes apply only when you run Format. Minify and Check also read the current content.

03

Export or revisit earlier content

Copy and Download export the full current content, including manual edits. The original is kept before the first transformation; editing, actions, examples and clearing share Undo and Redo.

Three ways to inspect one stylesheet

Readable formatting

Prettier lays out nested blocks and declarations while retaining comments and their source order, making a dense file easier to review.

Conservative compression

The compact result removes optional spacing and ordinary comments without sorting declarations, merging rules or shortening values.

Source rule directory

Selectors and at-rules come from the current CSS, with current line and column positions. Long lists appear in batches; copying and downloading always use the full current document.

Where this parser draws the line

CSS syntax, not browser support
Check finds structural parsing errors. A valid result does not prove that every selector, property or feature is supported by your target browsers.
No SCSS or Less interpretation
This CSS formatter expects CSS. Preprocessor variables, mixins and control directives need their own compiler before you use this page.
No semantic optimization
Formatting preserves comments and order; Minify removes ordinary comments and whitespace but does not sort properties, remove repeated declarations or merge rules.
No project or page preview
The tool processes pasted CSS without fetching URLs or simulating a real HTML page. Undo history lives only in this tab’s memory and is not retained after closing it.

CSS formatter questions from real workflows

Can it expand a minified CSS file?

Yes. Paste the compressed CSS and run Format. The result adds readable line breaks and indentation; comments already removed by earlier minification cannot be recovered.

Which validation problems are detected?

The parser reports structural problems such as an unclosed block or malformed declaration with a source line and column. It does not run a cross-browser compatibility audit.

Do I need to select a CSS version?

No version switch is required for standard CSS. A new or vendor-specific feature may still need testing in the browsers your project supports.

Are double-slash comments valid CSS?

No. CSS comments use /* and */. A double slash is not a CSS comment and may be treated as invalid tokens or part of a value; replace it before relying on the result.

Can I format files automatically as part of a project?

This page runs on pasted text when you choose an action. For automatic formatting of repository files, use a formatter in your editor or build workflow.

Still have a question?

Format the CSS you are reviewing

Return to the CSS formatter to format and minify in one editor, inspect the current rules, and copy or download the current content.

Every action uses the current content. Open the original or use Undo to go back.