How to use the JSON Formatter & Validator
- Paste your JSON into the left box, or click Load sample.
- Pick an indent (2 spaces, 4 spaces or tab) and tick Sort keys if you want keys alphabetical.
- Read the result on the right. Errors show the line and column, and the cursor jumps to them.
- Click Copy to grab the formatted JSON.
What a JSON formatter does
APIs, log files and minified configs often return JSON as one long line. A formatter (also called a JSON beautifier or pretty-printer) adds line breaks and indentation so you can read the structure: which keys belong to which object, and where each array starts and ends.
{"id":1042,"paid":true,"items":["thai tea"]}
becomes
{
"id": 1042,
"paid": true,
"items": [
"thai tea"
]
}
Common JSON errors this validator catches
- Trailing commas like
[1, 2, ], which JavaScript allows but JSON does not. - Single quotes around strings or keys. JSON requires double quotes.
- Unquoted keys such as
{name: "Ann"}. - Comments (
//or/* */), which are not part of the JSON standard. - Missing brackets or an extra closing brace.
Frequently asked questions
Is this JSON formatter free?
Yes. Every curlybits tool is free with no sign-up and no limits beyond what your browser can handle.
Is my JSON uploaded anywhere?
No. Formatting and validation run entirely in your browser with JavaScript. Your data never reaches a server.
How do I find the error in invalid JSON?
The status bar shows the error message with its line and column, and the cursor jumps to that spot in the input box.
Can I sort JSON keys alphabetically?
Yes. Tick Sort keys and every object, including nested ones, is output with its keys in alphabetical order. Array order is kept.