How to use the JSON Formatter
- Paste JSON into the left box (or open a .json file), or load one of the examples.
- Choose Beautify or Minify, your indentation, and whether to sort keys.
- Fix any error using the line, column and explanation shown.
- Copy or download the result, or open the tree view to explore it.
What does this tool do?
The formatter parses your JSON with the browser's native parser, so it's fast and follows the JSON standard exactly. If the JSON is invalid, it shows the line and column of the first problem, with a plain-English explanation such as “trailing comma” or “use double quotes”. The example buttons load valid JSON and the most common mistakes so you can see what each error looks like.
Minify removes all unnecessary whitespace for the smallest possible payload. Sorting keys makes files easier to scan and to compare. The tree view lets you fold and unfold large documents and shows the path of any value when you hover it. You're also warned when a key is repeated in the same object or when an integer is too large to survive parsing exactly.
Why use it?
- Read API responses and config files at a glance.
- Find syntax errors fast.
- Collapsible tree view for big documents.
- Safe for sensitive data: nothing is uploaded.
Example
Input: {"name":"Ada","skills":["math","code"]}
Output (2-space indent):
{
"name": "Ada",
"skills": [
"math",
"code"
]
}Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Frequently asked questions
Why is my JSON invalid?
The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys, comments, and values like undefined or NaN. The error message points to the exact spot.
Is there a size limit?
No fixed limit. Files of several megabytes format in well under a second on a modern computer.
How do I compare two JSON files?
Use JSON Diff. It compares two documents by structure and lists every added, removed and changed property with its path.
Last reviewed by the M2Toolkit team.