โœจ 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