CSS Formatter & Minifier

Format, minify and clean up CSS in your browser. Pretty-print rules, compress stylesheets, remove empty blocks and copy the result. Free, no upload.

What this tool does

CSS Formatter turns messy or minified stylesheets into readable code — and the other way round. Paste your CSS, choose a layout mode and the result appears on the right. Everything runs locally in your browser; no code ever leaves your machine.

How the screen is laid out

Two panels sit side by side: the CSS input on the left and the formatted result on the right. The toolbar underneath holds two checkboxes and three buttons. On phones the panels stack vertically.

Basic operations

Paste or type your CSS into the left panel. Syntax highlighting marks selectors, properties, values and comments so structure is easy to follow.

  • Format: normalises the code (collapses stray whitespace, fixes spacing around punctuation) and prints it using the current layout mode.
  • Minify: strips every line break and redundant space, producing the shortest form for production use.
  • Copy: copies the plain text of the result; the button flashes orange to confirm.

Layout modes

Horizontal (default) keeps one rule per line with all of its declarations inline, e.g. body{margin:0;font-size:12px;}. Clear this option to switch to vertical mode, where each declaration gets its own indented line — easier to read and edit by hand.

Comments

"Strip comments" is on by default: /* ... */ blocks are removed while formatting or minifying. Turn it off to keep them.

Other details

All styles and scripts are scoped to the .cstool container, so the widget can be embedded in any page without leaking styles. The layout adapts to mobile, where buttons stretch to full width.

When to use it

Restoring readability to a minified file, keeping a team on one code style, or producing clean code snippets for documentation and tutorials.

    Rating
    5 stars · Excellent
    Code
    No reviews yet — be the first to write one.