Skip to content

CSS Formatter

Runs in your browser

One declaration per line when you’re reading it, one line when you’re shipping it. Working on JavaScript? Switch to the JavaScript Formatter.

Input

Output

Formatting…

How this one works

Beautify puts each selector on its own line, each declaration on its own indented line, and a blank line between rules — including rules nested inside @media queries.

Minify removes comments and every space the browser doesn’t need, and drops the last semicolon in each block. Text inside quoted strings, like a content value, is left exactly as written.

Questions

Does minifying change how my styles work?
No. Only comments and optional whitespace are removed. Selectors, property values and strings stay the same, so the browser applies exactly the same styles.
Does it support SCSS or Less?
Beautify handles most SCSS and Less syntax, since it works on braces and declarations. Minify is designed for plain CSS; compile SCSS or Less first, then minify the output.
Is my CSS uploaded?
No. Formatting runs in your browser tab, and nothing you paste is sent to a server or stored.

Keyboard shortcuts

Global

  • Show this shortcuts dialogShift?
  • Toggle light / dark themeCtrlShiftL
  • Close dialogsEsc

Formatter & Validator

  • Format JSONCtrlEnter
  • Minify JSONCtrlShiftM
  • Copy outputCtrlShiftC
  • Download output as .jsonCtrlShiftS
  • Clear input and outputCtrlShiftX

Tree Viewer

  • Focus the search box/
  • Expand all nodesCtrlShiftE
  • Collapse all nodesCtrlShiftR

Diff

  • Swap document A and BCtrlShiftS

JSON tools

JSON FormatterPretty-print or minify
JSON ValidatorCheck strict JSON validity
JSON Tree ViewerBrowse JSON as a tree
JSON DiffCompare two documents
JSON Path FinderExplore JSONPath expressions
JSON → CSVFlatten JSON into rows
CSV → JSONTurn rows back into objects

JWT tools

JWT DecoderRead header, payload, claims
JWT VerifierCheck an HMAC signature
JWT Expiry Checkeriat, nbf and exp in local time
JWT GeneratorBuild a signed test token
Base64URL EncoderEncode or decode a segment

Code formatters

SQL FormatterBeautify or minify SQL
HTML FormatterBeautify or minify HTML
CSS FormatterBeautify or minify CSS
JavaScript FormatterBeautify or minify JS
Markdown to HTMLConvert with a live preview

Pages

JSON toolsFormat, validate, compare and convert JSON.
JWT toolsDecode, verify and generate JSON Web Tokens.
Code formattersBeautify and minify SQL, HTML, CSS and JavaScript.
HomePopular tools and categories
All categoriesBrowse tools by category
AboutWhat ToolJar is and why
PrivacyWhat is and is not collected

Theme

Switch to light theme
Switch to dark theme