CSS viewer and formatter
Beautify or minify CSS, list its colours and rules, and preview it on sample elements or your HTML.
Use your own HTML
- Rules
- —
- Selectors
- —
- Declarations
- —
- Size
- —
No colour found.
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
- Paste your CSS.
- Press Format to beautify it, or Minify to compress it.
- Check the preview, the counters and the colour list.
- 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.