Contents › § 1

JSON formatter

Paste JSON on the left. It is formatted as you type, and if it is broken you get the line and column of the first error.

Input
Output

§ 1.1What the formatter does

It parses your text with the browser’s own JSON.parse — the same strict parser your JavaScript code uses — and prints it back with consistent indentation. If parsing fails, nothing is guessed or repaired: you see the parser’s message and the line and column where it stopped, so you can fix the real problem.

§ 1.2The errors you’ll actually hit

SymptomCause
Unexpected token }A trailing comma before } or ]. JSON doesn’t allow it.
Unexpected token 'Single quotes. JSON strings and keys need double quotes.
Unexpected token /Comments. Standard JSON has none; JSONC and JSON5 do.
Unexpected token in property nameAn unquoted key, like {id: 1}.
Bad control character in stringA raw line break or tab inside a string — escape it as \n or \t.

§ 1.3Things to know

§ 1.QQuestions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser tab; you can disconnect from the internet and it still works.

What is the difference between formatting and validating?

Formatting assumes the JSON is valid and re-prints it. The JSON validator focuses on explaining what is wrong and where.

§ 1.RReferences

Last reviewed 2026-10-14.