JSON formatter & validator
Beautify messy JSON, find errors by line and column, repair broken JSON in one click, explore it as a tree and convert it to YAML, CSV or XML. Everything runs in your browser.
Paste or type JSON to begin
Input
What is JSON, and how to fix common JSON errors
JSON (JavaScript Object Notation) is the text format most APIs, apps and config files use to store data. It is easy to read, but very strict: one missing quote or extra comma and the whole file stops working. This tool shows you exactly where the problem is.
The JSON rules in one minute
- Data is written as objects
{ }of "key": value pairs, and arrays[ ]of values - Keys and text must be in double quotes
- Values can be text, numbers, true, false, null, objects or arrays
- Items are separated by commas, but no comma after the last one
- No comments are allowed
{
"name": "Ayesha Khan",
"age": 28,
"skills": ["SEO", "Excel"],
"address": { "city": "Lahore" },
"married": false
}
Common errors and how to fix them
| Problem | Wrong | Right |
|---|---|---|
| Trailing comma | [1, 2,] | [1, 2] |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| Key without quotes | {name: "Ali"} | {"name": "Ali"} |
| Missing comma | {"a": 1 "b": 2} | {"a": 1, "b": 2} |
| Python values | True / None | true / null |
| Line break in text | "line 1↵line 2" | "line 1\nline 2" |
Press Repair and the tool fixes all of these for you, then tells you what it changed.
More free developer & data tools
Frequently asked questions
How do I format JSON online?
Paste your JSON in the input box and press Format (or Ctrl + Enter). Choose 2 spaces, 4 spaces or tabs, and turn on Sort keys if you want the keys in A–Z order. Copy the result or download it as a .json file.
How do I find the error in my JSON?
The validator checks your JSON as you type. If something is wrong it shows a plain-English message with the exact line and column, highlights the line number and points to the character. Press Go to error to jump there.
What can the Repair button fix?
Trailing commas, missing commas between lines, single or curly quotes, keys without quotes, comments, True/False/None, undefined and NaN, numbers like .5, JavaScript wrappers such as var data = {…}; and JSON that was saved as an escaped string.
Is my JSON uploaded to a server?
No. Formatting, validation and conversion all happen in your browser, so it is safe to use with API responses, configuration files and private data.
Will the formatter change my numbers?
No. Many formatters round large numbers such as 90071992547409931 because JavaScript cannot store them exactly. This tool keeps every number exactly as you wrote it.
Can I convert JSON to CSV for Excel?
Yes. Open the CSV tab. Arrays of objects become rows, nested fields become columns such as address.city, and the download opens correctly in Excel, including Urdu and other non-English text.