How to use the JSON formatter
- Paste your JSON into the box, or press Try an example.
- Choose 2 spaces, 4 spaces, tabs or minified output.
- Tick Sort keys A to Z to put every object's keys in order, which makes two JSON files easy to compare.
The JSON is checked as you type. If it isn't valid, you see the line and column of the first problem.
Common JSON mistakes
- Single quotes. JSON needs double quotes around keys and text:
{"name": "Asha"}. - A comma after the last item:
[1, 2, 3,]is not allowed. - Keys without quotes:
{name: "Asha"}is JavaScript, not JSON. - Comments. JSON has no comments, so remove
//and/* */lines.
Your JSON never leaves your browser, so it is safe to format API responses and config files that hold private data.