Tools Hub

CSS Formatter & Minifier

Indent tangled stylesheets or minify them while keeping licenses intact.

Browser onlyYour data never leaves this device.

Runs entirely in your browser. Your stylesheet never leaves this device and is never stored.

Details: Privacy policy

Input

Modes apply live. Nothing is stored.

Mode

Result

No CSS yet.

Paste a stylesheet above to transform it.

CSS Formatter and Minifier re-indents a tangled stylesheet into something readable, or minifies a finished one for delivery, and it keeps license headers intact in both directions. The readable mode uses two spaces per level rather than trying to preserve whatever indentation the file arrived with, because mixed tabs and spaces are exactly what makes a copied sheet hard to read in the first place. The minified mode collapses the whitespace a browser does not need while leaving the comments that carry a license, since stripping an attribution to save a few bytes is not a trade this page makes on your behalf. Unbalanced braces are rejected rather than quietly repaired: a sheet whose braces do not close is a sheet with a real problem, and silently rewriting it would hide the problem until it reached a browser. Input is capped at a million characters per run, and nothing is uploaded - the work happens in your browser on the text you pasted.

How to use CSS Formatter & Minifier

  1. Paste CSS and pick format or minify mode.
  2. Toggle comment preservation for minify mode.
  3. Copy or download the result, or clear to start over.

What you get

  • A re-indented stylesheet using two spaces per level, or a minified one when you choose that mode.
  • A license header preserved through minification rather than stripped with the rest of the comments.
  • A rejection of unbalanced braces instead of a silent rewrite, so a malformed sheet is never made to look valid.

When to use CSS Formatter & Minifier

  • Re-indent single-line CSS copied from browser devtools before editing.
  • Minify a finished stylesheet while keeping its license header intact.
  • Diff two generated stylesheets by formatting both the same way first, so indentation stops obscuring the real changes.

Frequently asked questions about CSS Formatter & Minifier

Does the CSS formatter upload my stylesheet?

No. Parsing and re-emitting run locally in your browser; nothing is sent, stored, or logged.

Are license comments preserved when minifying?

Yes. License headers starting with /*! survive every mode. Other comments survive only when comment preservation is switched on.

How are custom properties handled?

Like any declaration: --brand: #123 stays attached to its rule and keeps its exact value, including Unicode content.

Why was my stylesheet rejected?

Unbalanced braces fail validation with a clear message. Fix the missing brace and retry — the tool never rewrites malformed CSS silently.

Guides that compare CSS Formatter & Minifier

⚡Embed CSS Formatter & Minifier on Your Site & Get Badge↓

Embed this in-browser tool into any blog, documentation, or dashboard. Includes an optional dofollow backlink badge to credit Tools Hub.

Height:
<iframe src="https://salaq.com/embed/developers/css-formatter-minifier" title="CSS Formatter & Minifier — Tools Hub" width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden;max-width:100%;" loading="lazy"></iframe>
<p style="font-size:12px;color:#6b7280;margin-top:6px;font-family:system-ui,-apple-system,sans-serif;">Powered by <a href="https://salaq.com/tools/developers/css-formatter-minifier" target="_blank" rel="noopener" style="color:#2563eb;text-decoration:underline;">CSS Formatter & Minifier on Tools Hub</a></p>

Feedback

Send feedback about this tool (placeholder — feedback collection is not wired up yet).