Example
Input (minified CSS)
.btn{padding:8px 16px;border-radius:6px;background:#5b21b6;color:#fff}.btn:hover{background:#4c1d95}Output (formatted)
.btn {
padding: 8px 16px;
border-radius: 6px;
background: #5b21b6;
color: #fff
}
.btn:hover {
background: #4c1d95
}Note
Selectors, media queries, and @keyframes all get indented. CSS-in-JS inline styles require a different tool.
Usage / FAQ
When to use
- Restore readability for minified CSS bundles (Tailwind, CSS-in-JS, …)
- Tidy CSS before pasting into issues or Slack
- Visualize nested rules: media queries, @keyframes
- Indent one-liner CSS produced by an AI
- Use minify mode for a first-pass production compress
FAQ
- Q.Does selector or property order change?
- A.Not in format mode — only whitespace and indentation change. Minify mode makes changes that keep the meaning: it shortens values (blue → #00f, 0.5 → .5), reorders properties within a rule, removes declarations that a later one overrides, and merges neighboring rules with identical contents.
- Q.Does it support CSS nesting?
- A.Both formatting and minifying do. Minifying keeps nesting as it is instead of flattening it — nested rules such as &:hover and range media queries (@media (width >= 600px)) stay in the result.
- Q.Does it handle SCSS or Less?
- A.Formatting is best-effort for plain CSS, so SCSS / Less-only syntax such as variables, @if, or mixins may come out wrong. Minifying leaves out anything it can't read as standard CSS (SCSS variables such as $x: …) and shows where, while unknown at-rules such as @mixin are kept as they are. Compile SCSS to CSS before minifying.
- Q.Does minifying change prefixes like -webkit-?
- A.Minified output targets browsers from about 2021 on (Chrome / Edge 90, Firefox 88, Safari 14 and later). Prefixes those browsers still need are added (-webkit-backdrop-filter next to backdrop-filter), and old prefixes they don't need (-moz-user-select and the like) are removed. Fallbacks placed before newer values they don't understand (the first of height: 100vh; height: 100dvh) are kept. Some properties such as display and overflow keep only the last value even with a fallback (overflow: hidden; overflow: clip → clip), so check the result if you rely on such a fallback.
- Q.Is my CSS sent anywhere?
- A.No. Everything runs in the browser. The first time you pick minify mode, the minifier engine (lightningcss, WebAssembly) is downloaded from this site, but the CSS you enter is never sent anywhere.
Fun facts
CSS was first proposed to the W3C in 1994 by Norway's Håkon Wium Lie (at CERN at the time, later CTO of Opera). Together with Bert Bos, he finalized CSS Level 1 in 1996. The simple idea of 'separate document structure (HTML) from presentation (CSS)' became the standard paradigm of web design.
W3C — CSSStarting with CSS3, the spec stopped being a single document and became **modular** — Selectors Level 4, Grid Layout, Flexbox, and the rest each evolve independently. That's why 'CSS4' doesn't officially exist — every module carries its own version.
W3C — CSS current workDuring the late-1990s 'browser wars,' IE and Netscape raced to ship non-standard CSS extensions, making compatibility a nightmare. One reason CSS's cascade and specificity rules look so complex today: they handle the chaotic diversity of that era consistently.
Wikipedia — Browser wars
Related guides
Related tools
- JSON Formatter / Validator
Format, validate, and minify JSON strings. Adjust indent and optionally sort keys. Runs entirely in your browser.
- String Case Converter
Convert strings between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, and Title Case — all six cases shown side-by-side.
- Regex Tester
Test JavaScript regular expressions with live match results. Supports g/i/m/s/u/y flags and capture groups.
- Markdown Preview
Render Markdown to HTML side-by-side. Supports CommonMark + GFM (tables, fenced code, task lists). Everything runs in your browser.
- HTML → Markdown
Convert HTML into Markdown. Headings, lists, links, code, tables, blockquotes. Uses the browser's DOMParser — accurate, 0 dependency.
- YAML ↔ JSON
Convert between YAML and JSON. Tolerates comments and multiline strings on the YAML side. Everything runs in your browser.
- Text Diff
Compare two texts and highlight added/removed lines, words, or characters.
- JSON Diff
Compare two JSON values, with optional key sorting and JSON-aware error messages.
- CSV ↔ JSON
Convert between CSV and JSON. Handles quoted fields, custom delimiters, and header rows.
- SQL Formatter
Format SQL queries with proper indentation and keyword casing. Supports PostgreSQL, MySQL, SQLite, and standard dialects.
- XML Formatter
Pretty-print or minify XML with attribute preservation. Handles SOAP, sitemaps, and config files.
- XML ↔ JSON
Convert between XML and JSON with attribute and element handling.
- Smart Paste
Paste any text and get tool recommendations — JSON, JWT, Base64, URL, UUID, Cron, and 9 more types auto-detected.
- Lorem Ipsum
Generate placeholder text in words, sentences, or paragraphs. Classic Lorem Ipsum or randomized.
- JSON Path
Query JSON with JSONPath expressions ($.store.book[*].author etc.) and inspect matches.
- JSON Schema Validator
Validate JSON data against a JSON Schema (Draft 2020-12). Powered by Ajv with format support.
- JSON Schema Generator
Generate a JSON Schema (Draft 2020-12) from a sample JSON. Infer types, required fields, and nested structures automatically.
- HTML Formatter
Beautify or minify HTML with proper indentation. Preserves pre/textarea whitespace.
- JavaScript Formatter
Beautify or minify JavaScript with indent options. Powered by js-beautify.
- TOML ↔ JSON
Convert between TOML (Tom's Obvious Minimal Language) and JSON. Used in Cargo.toml, pyproject.toml, etc.
- INI ↔ JSON
Convert INI configuration to JSON and back. Supports sections, comments (; or #), and key=value.
- JSON → TypeScript
Generate TypeScript interfaces from a JSON sample. Nested objects become separate interfaces.
- JS Object → JSON
Convert a JavaScript object literal (unquoted keys, single quotes, trailing commas, comments) into standard JSON. Lenient parser, strict output.
- Slug Generator
Convert text into a URL-safe slug. Configurable separator, lowercase, and accent stripping.
- ASCII Tree
Convert indented text or path list into a box-drawing tree (├── │ └──).
- Diff Patch
Generate a unified diff (-u) patch from two text inputs. Compatible with `git apply` / `patch -p0`.
- Mock Data
Generate fake JSON records and SQL INSERT seed data — names, emails, custom fields, UUIDs, dates, and more. 0 dependency.
- MongoDB Extended JSON
Convert MongoDB Extended JSON (EJSON) between Canonical and Relaxed forms, or strip BSON wrappers to plain JSON. Recognizes 16 wrapper types ($oid/$date/$numberLong/$numberDecimal/$binary/...).
- Kubernetes YAML Visualizer
Paste Kubernetes manifests and see the resource graph — Deployments, Services, Ingresses, ConfigMaps, Secrets, PVCs, and how they connect. Everything runs in your browser.
- Docker Compose Visualizer
Paste docker-compose.yml and see services, networks, volumes, and depends_on as an interactive graph. Everything runs in your browser.
- PDF Text Extractor
Extract text from a PDF file — page by page or as a single document. Markdown-friendly output, all client-side.
- PPTX Text Extractor
Extract slide text from a .pptx file — plain / markdown / per-slide. Great for converting decks to markdown. All client-side.
- Regex Railroad Diagram
Visualize your regex as a railroad diagram — trace branches, groups, and quantifiers at a glance, in your browser.
- Word & Character Counter
Count characters (with/without spaces), words, sentences, paragraphs, lines, and bytes in real time — free, in your browser.
- LLM Token Counter
Count LLM tokens and estimate cost — exact for GPT (tiktoken), estimated for Claude/Gemini. Context-limit gauge. All in your browser.