T-50 · Developer tools
CSS Minifier and Beautifier
Minify CSS to cut file size, or beautify it with one declaration per line. Strings, url() values and calc() spacing are kept safe. Shows % saved.
- Runs in your browser
- Nothing uploaded
- No account
About this instrument
What it does
Paste a stylesheet to minify it for production or beautify it for reading. Minifying removes comments and unnecessary whitespace and the last semicolon in each block; beautifying puts one declaration per line with the indent you choose and indents rules nested in @media and similar blocks. The size before and after and the percentage saved are shown as you type.
How to use it
- Paste your CSS.
- Choose Minify or Beautify (and an indent).
- Copy or download the result.
FAQ
Common questions.
01How much smaller will my CSS get?
It depends on how much whitespace and how many comments the file has. Hand-written, commented CSS often shrinks by 20 to 40%; already-compact CSS barely changes.
02Is it safe to remove the last semicolon in a block?
Yes. In CSS the semicolon separates declarations, so the one before the closing brace is optional.
03Does it handle modern CSS?
Custom properties, nesting, @media, @supports, @container and @layer blocks are tokenised like any other CSS. It does not check that your CSS is valid.
Related instruments
- T-38HTML Encode / DecodeEscape text for HTML with entities such as < and &, or decode named, decimal and hex entities back to text. Safe, local and instant.Local
- T-49XML FormatterPretty-print or minify XML with 2 or 4 spaces or tabs, and check it is well-formed. Errors show the line and column of the first problem.Local
- T-05JSON FormatterFormat, validate and minify JSON with clear error messages that point to the line and column. Runs entirely in your browser.Local