JSON Parser

CSS Minifier & Beautifier Online

Minify CSS to cut file size, or beautify a compressed stylesheet into readable rules. Comments and extra whitespace are removed when minifying, strings are preserved, and the shorter output behaves identically. Everything runs in your browser.

How to format or minify CSS

  1. Paste your CSS into the Input box.
  2. Choose Beautify for readable output or Minify for the smallest output. The result updates as you type.
  3. Click Copy to copy it. In Minify mode the badge shows how much smaller the output is.

Example

Input CSS

/* Card */
.card{display:flex;gap:12px;padding:16px 20px;border-radius:12px;background:#fff}
.card:hover{box-shadow:0 4px 12px rgba(0,0,0,.15)}
@media (max-width:640px){.card{padding:12px}}

Beautified

/* Card */
.card {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: #fff
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15)
}

@media (max-width:640px) {
  .card {
    padding: 12px
  }
}

Same input

/* Card */
.card{display:flex;gap:12px;padding:16px 20px;border-radius:12px;background:#fff}
.card:hover{box-shadow:0 4px 12px rgba(0,0,0,.15)}
@media (max-width:640px){.card{padding:12px}}

Minified

.card{display:flex;gap:12px;padding:16px 20px;border-radius:12px;background:#fff}.card:hover{box-shadow:0 4px 12px rgba(0,0,0,.15)}@media (max-width:640px){.card{padding:12px}}

Tips

  • Minify removes comments, whitespace and the last semicolon in each rule.
  • Beautify expands rules onto separate lines with your choice of indentation.
  • Keep your original file and serve the minified copy.

Related tools

Minify JavaScript and HTML the same way, convert colors with the color converter, or embed small images with Image to Base64.

Frequently asked questions

How do I minify CSS?
Paste your stylesheet and choose Minify. Comments, extra whitespace and the last semicolon in each rule are removed, and strings are preserved, so the CSS behaves identically but is smaller.
How do I format minified CSS?
Choose Beautify to expand a minified stylesheet into readable, consistently indented rules. You can pick 2 spaces, 4 spaces or tabs.
Is minified CSS safe to use in production?
Minification only removes characters that have no effect on rendering. Keep your original source file and serve the minified copy. Everything runs in your browser — your code is never uploaded to a server.
Handles JSON files up to 20MB smoothly