✨ JavaScript / CSS Formatter

Indents JS/CSS code based on braces and semicolons. (A lightweight formatter — not a full parser-based formatter like Prettier)

How to use

  1. Choose CSS or JavaScript.
  2. Enter your code.
  3. Click "Format" to see indented code.

🎯 Use Cases

Example

Input
.a,.b{color:red;font-size:12px}
Output
.a,.b {
  color: red;
  font-size: 12px
}

A single-line, minified CSS rule expanded in CSS mode. The formatter breaks after the opening brace, indents each declaration by two spaces, and adds a space after the colon in property: value.

FAQ

Is this a full formatter like Prettier?
No. It's a lightweight formatter that indents based on braces and semicolons. It safely preserves strings, comments, and template literals, but doesn't enforce detailed style rules.
Can it clean up minified code too?
Yes. Code squashed onto a single line is also line-broken and indented based on braces and semicolons.
Is the code I enter sent to a server?
No. It's processed entirely in your browser.

More Coding Tools

📘
JSON Formatter
Prettify, validate & minify JSON
🗓️
Timestamp Converter
Convert Unix timestamp ↔ date
🧩
JSON String Encoder
Convert text ↔ JSON string literal
✂️
JS/CSS Minifier
Strip comments & whitespace
🧽
HTML Formatter
Indent HTML by tag structure
🧹
XML Formatter
Indent XML by tag structure
🗃️
SQL Formatter
Break SQL into clauses & indent
🔣
HTML Entity Encoder
Convert special chars ↔ HTML entities
📊
Excel to HTML Table
Convert spreadsheet data to HTML TABLE
⛓️
Link Extractor
Extract href/src links from HTML
🎨
Color Picker
Get HEX, RGB & HSL color codes
🐘
PHP Syntax Checker
Check bracket/string pairing (practical checker)
🗄️
MySQL Syntax Checker
Check bracket/quote pairing (practical checker)
🔍
HTML5 Validator
Check tag pairing, duplicate id, missing alt
✍️
Online HTML Editor
Write & edit HTML visually