JSON Formatter and Validator
Paste JSON to check that it is valid and pretty-print it with consistent two-space indentation. Invalid JSON shows an error instead of a result.
How to Use the JSON Formatter and Validator
- Paste your JSON into the input box, for example an API response or a config file.
- If the JSON is valid, the formatted version appears in the result panel. If not, an error message appears.
- Copy the formatted JSON or save it as a text file.
Example
- Input
- {"name":"Sam","active":true,"roles":["admin","editor"]}
- Output
- { "name": "Sam", "active": true, "roles": [ "admin", "editor" ] }
About the JSON Formatter and Validator
Minified JSON from APIs, logs and config files is hard to read. Formatting adds line breaks and indentation so you can scan the structure, spot missing fields and compare objects. Developers, QA testers and analysts use it while debugging.
The input is parsed with the browser’s built-in JSON parser, so it follows the strict JSON standard: keys and strings need double quotes, and trailing commas and comments are not allowed. Very large numbers beyond JavaScript’s safe integer range may lose precision when re-formatted.
Frequently Asked Questions
Why does my JSON show as invalid?
The most common causes are single quotes instead of double quotes, a trailing comma after the last item, unquoted keys, or comments. Strict JSON allows none of these.
Does it also validate JSON?
Yes. If the text cannot be parsed as JSON, you see an error message instead of formatted output.
Can it minify JSON?
No. This tool only formats with two-space indentation.
Is my JSON sent to a server?
No server is involved in formatting. The JSON is parsed and formatted in your browser, and this tool does not upload it.
Related Tools
All developer tools →Convert a JSON array of objects into a CSV file you can open in a spreadsheet.
Beautify, validate or minify XML without rendering it.
Test JavaScript regular expressions with highlighted matches and capture groups.
Encode text to Base64 or decode Base64 back to readable text.