Skip to content
Language:en

CSS viewer and formatter

Beautify or minify CSS, list its colours and rules, and preview it on sample elements or your HTML.

Preview
Use your own HTML
Rules
—
Selectors
—
Declarations
—
Size
—

Colours used

    Runs entirely in your browser. Your files never leave your device.

    About this tool

    A minified stylesheet on one endless line is impossible to read. Paste it here and Format splits it into one declaration per line with nested blocks indented, or Minify does the opposite to save bytes before you ship it. Strings, URLs and comments are left intact.

    The preview applies your CSS live to a small sample page with headings, links, a button, a quote and a table, or to your own HTML if you paste some. Below, the counters show rules, selectors and declarations, the size before and after minifying, and every colour the stylesheet uses, with a swatch you click to copy. Handy for auditing a theme or picking colours from a site you are rebuilding. Everything runs in your browser.

    How it works

    1. Paste your CSS.
    2. Press Format to beautify it, or Minify to compress it.
    3. Check the preview, the counters and the colour list.
    4. Copy or download the result.

    Minifying keeps comments that start with /*! (licence notices) and removes the others, along with every unnecessary space and the last semicolon of each block.

    Worked example

    A theme’s minified stylesheet of 48 KB on a single line: Format splits it into readable rules, and the colour list shows 37 distinct colours, including near-duplicates such as #333, #343434 and #353535 that could be merged into one variable.

    Before shipping your own stylesheet, Minify shows how much it saves, often 15 to 30 % before compression.

    Good to know

    • Merge near-identical colours into custom properties (--text, --muted…) to keep a theme consistent.
    • Minification and gzip or Brotli add up; together they shrink CSS a lot more than either one alone.
    • Paste your own HTML in the preview to see the stylesheet on real markup.

    Frequently asked questions

    Does formatting change how the CSS works?
    No. Only spaces and line breaks change; selectors, values, strings and comments are kept exactly as written.
    How much does minifying save?
    Usually 15 to 30 % on a hand-written stylesheet, more if it has many comments. Your server’s gzip or Brotli compression then saves a lot more.
    Which colour formats are detected?
    Hex codes with 3, 4, 6 or 8 digits and the rgb(), hsl(), hwb(), lab(), lch(), oklab() and oklch() functions. Named colours such as “red” are not listed.
    Can I see my stylesheet on my own page?
    Yes. Open “Use your own HTML” under the preview and paste the markup; the preview switches from the sample page to yours.