JSON Formatter
Format and beautify JSON with your choice of indentation, and find syntax errors by line and column.
Runs in your browser. Your input stays on your device.
Check whether your JSON is valid. When it is not, see the line and column, the code around the problem, and a hint for common mistakes. Valid JSON gets a structure summary plus warnings for duplicate keys and unsafe numbers.
Opens a file from your device. The file is read in your browser and is not uploaded.
Showing a large file in the editor can make the page slow or unresponsive for several seconds.
0 characters · 0 B
Result
Privacy: This tool runs in your browser. Your input is processed on your device and is never uploaded to a server.
An array with a trailing comma, and the report the validator gives for it.
{
"name": "Example Widget",
"price": 19.99,
"tags": ["tools", "hardware",],
"inStock": true
}Invalid JSON at line 4, column 31
Trailing comma before ']'. JSON does not allow a comma after the last item.
2 | "name": "Example Widget",
3 | "price": 19.99,
4 | "tags": ["tools", "hardware",],
| ^
5 | "inStock": true
6 | }
Hint: Remove the comma after the last item. JSON does not allow a comma before } or ].Input that follows the JSON standard, RFC 8259: strings and property names in double quotes, commas only between items, no comments, and values limited to objects, arrays, strings, numbers, true, false, and null. This tool checks syntax. It does not check your data against a JSON Schema.
The standard does not forbid repeating a key inside one object, so the document still passes. In practice most parsers, including JavaScript’s JSON.parse, keep only the last value and silently throw the others away, which can hide a real bug. The warning lists the path of every repeated key so you can decide which value should stay.
JavaScript stores every number as a 64-bit floating point value, which holds whole numbers exactly only up to 9,007,199,254,740,991. Bigger integers, such as some database IDs, are rounded when a browser or Node.js parses them. The warning shows each affected path, the number as written, and the value JavaScript would actually read. Sending such values as strings avoids the problem.
After the first mistake, a parser can only guess what the author meant, so anything it reported beyond that point would often be wrong or confusing. Fix the reported error, validate again, and repeat until the JSON passes.
Article Published
Format and beautify JSON with your choice of indentation, and find syntax errors by line and column.
Shrink JSON by removing whitespace without changing any values, and see how much smaller it gets.
Convert CSV or TSV to JSON with delimiter detection, header handling, and optional, lossless type detection.