DEVELOPER & DATA

Code Beautifier

Paste JavaScript, CSS, JSON, HTML, SQL or XML — the language is detected — and get it beautified (or minified) with your indent, in your browser, no upload.

Formatted code with the detected language and the reason it was chosen, routed to the matching formatter, plus line and byte counts; switch the language if the guess is wrong.

Example: "select a, b from t where x = 1" is detected as SQL and laid out clause by clause; "{"a":1,"b":[1,2]}" as JSON and indented; "a{color:red}" as CSS with one declaration per line.

v0.1.0 · last reviewed 20 September 2026
Loading the workspace…
BUILT TO BE UNDERSTOOD

One box,
six formatters.

How the language is guessed, where each language is sent, and why the results are identical to the dedicated pages.

Detection

The text is tested in order: starts with { or [ and parses as JSON → JSON; starts with <?xml → XML; HTML tags (html, div, p, script, …) → HTML; any other opening tag → XML; a leading SELECT/INSERT/WITH/… → SQL; selector { property: value } blocks or a CSS at-rule without JavaScript keywords → CSS; otherwise JavaScript. The reason is shown so a wrong guess is easy to spot — pick the language yourself to override it.

Routing

JavaScript and CSS use the shared lexical formatters that power the JavaScript and CSS minifier pages; JSON, HTML, SQL and XML are handed to the engines of their dedicated utilities with your indent, so the output here is byte-for-byte what those pages produce (SQL keywords upper-case, trailing commas). Their own notes and errors (with line numbers) are passed through.

Limits

JavaScript is re-indented lexically, not parsed, and JSX is not handled; SQL layout is rule-based and dialect-agnostic; JSON offers 2, 4 or tab indent. Minify mode applies each formatter's minifier. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.

SOURCES

Last reviewed 20 September 2026. How results are checked: How we verify.