JSON Formatter and Validator
Format, validate and minify JSON, in your browser.
Think a result is wrong? Report it on GitHub
About formatting and validating JSON
Format, validate and beautify JSON with clear error locations and warnings for duplicate keys and large numbers. Files up to 100 MB, all in your browser.
Paste JSON or open a file to check it against the JSON standard (RFC 8259) and lay it out for reading. If it is not valid, the first problem is reported with its line and column and a plain description, such as a trailing comma or a comment, which JavaScript allows but JSON does not. Choose 2 or 4 spaces, tabs, or Minify to remove all whitespace. It checks syntax only, not a JSON Schema.
Why does my JSON fail to validate?
The usual causes are a trailing comma after the last item, a comment, single quotes instead of double quotes, a key without quotes, or a value such as NaN or undefined. JavaScript accepts all of these, but JSON does not. The error names the line and column of the first one.
Why do large numbers change in other tools?
{"id": 9007199254740993, "id": 2,} is rejected at the trailing comma. Remove it and the JSON is valid, with two warnings: the key id appears twice (most programs keep only the last value), and 9007199254740993 is too large for a JavaScript number, so most tools and programs silently turn it into 9007199254740992. This tool never rounds numbers: the output keeps them exactly as written.
Pitfalls
Sorting keys changes the order of object members, which signatures and some programs depend on. JSON over 1 MB, pasted or opened as a file (up to 100 MB), is formatted in the background so the page stays responsive. The output box shows at most the first 2,000 lines; Copy and Download take the whole result. Your JSON stays in this browser tab; nothing is uploaded or saved.