Format, beautify, minify and validate JSON online. Exact error line and column, collapsible tree view, sort keys and convert to CSV. Runs in your browser.
💡 Would you like a new tool or feature, or did something not work? Tell us at [email protected]
Paste your JSON into the box above, or drop in a sample with Load example.
Click Format to beautify it with the indent you choose, or Minify to compress it onto one line.
If the JSON has a mistake, you'll see what's wrong and the line and column where it is, and the cursor jumps there.
Explore the result in the Tree or Colored view, copy it, or download it as .json or .csv.
What is JSON?
JSON (JavaScript Object Notation) is a plain-text format for structured data. It's used by almost every web API, many configuration files and databases such as MongoDB. A JSON document is built from objects ({"key": value}), arrays ([1, 2, 3]), strings in double quotes, numbers, true, false and null.
Common JSON errors
Trailing commas: [1, 2, 3,] is valid JavaScript but not valid JSON.
Single quotes: strings and keys must use double quotes, "like this".
Unquoted keys: {name: "Ada"} must be {"name": "Ada"}.
Comments: // … and /* … */ aren't allowed in standard JSON.
Special numbers: NaN, Infinity, leading zeros like 007 and hex numbers are not JSON.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser with JavaScript. Nothing you paste is uploaded or stored, so it's safe for API responses, config files and other private data.
What's the difference between formatting and minifying?
Formatting (beautifying) adds line breaks and indentation so JSON is easy to read. Minifying removes all unnecessary whitespace so the file is as small as possible, which is what you want when sending JSON over a network.
Why is my JSON invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, property names without quotes, comments (JSON doesn't allow them) and unescaped line breaks inside strings. The validator shows the exact line and column of the first problem.
How do I explore a big JSON file?
After formatting, switch to the Tree view. Every object and array can be opened and closed, and each one shows how many items it has, so you can find your way through API responses with thousands of lines.
Can I convert JSON to CSV?
Yes. Click "Download as CSV". An array of objects becomes one row per object, with a column for every key; nested objects become dotted columns such as address.city.