How to use the JSON Validator & Formatter
How to validate JSON syntax
- Paste JSON into JSON input, or choose Upload and select a JSON or text file.
- Read the status below Formatted output while the value is parsed.
- Edit JSON input when the status says Invalid JSON, then review the output again.
- Choose Tree View to inspect nested objects and arrays as expandable nodes.
An empty input shows "Enter JSON to validate." A parseable value shows "Valid JSON." Invalid input shows "Invalid JSON:" followed by the parser message, clears Formatted output and Tree View, and disables Copy and Download.
How Indent and output options change JSON
Use Indent to choose 2 spaces, 4 spaces, or Tab for expanded output. Minify sets the spacing to zero. Sort keys orders object keys at every nested level; arrays keep their existing item order.
{"name":"Mira","active":true,"roles":["editor","reviewer"]}
With Indent set to 2 spaces, the value appears like this:
{
"name": "Mira",
"active": true,
"roles": [
"editor",
"reviewer"
]
}
Minify produces {"name":"Mira","active":true,"roles":["editor","reviewer"]}. The result comes from JSON.stringify, so strings use double quotes and values keep their JSON types.
Tree View shows the parsed root as an object, array, or primitive value. Object and array nodes have controls for expanding and collapsing children. Primitive nodes show their type and value. Formatted output keeps the punctuation and whitespace visible.
The page's JavaScript parses and formats the entered value in the browser. Its code contains no fetch, XMLHttpRequest, sendBeacon, or form post that sends the entered JSON elsewhere.
JSON validator or JSON Schema Validator?
This JSON Validator & Formatter checks JSON syntax and changes its presentation. It has no schema field and does not compare properties, types, or required values with rules. Use the JSON Schema Validator when a JSON Schema should determine the violations.
For line-delimited records, use the JSONL Validator & Formatter, which parses each nonblank line independently. For two JSON documents that need a difference report, JSON Diff compares the documents. The parent JSON Validate Tools category groups these validation tasks.
Where JSON validation comes up
Paste a JSON response into JSON input to check punctuation or quoting before using it elsewhere. Formatted output shows the nesting, and the status reports whether the text parses.
For a local configuration file, choose Upload and select the file. Sort keys orders object keys recursively, and Download saves the processed result as formatted.json.
When a value has several nested levels, switch to Tree View. Collapse an object or array, then inspect a child field's type and value.
Frequently asked questions
How do I fix invalid JSON syntax?
Fix the punctuation or quoting in JSON input, then review the status again. Invalid input clears Formatted output and Tree View until JSON.parse can read the value.
How do I format JSON with 4 spaces?
Choose 4 spaces in the Indent control. Formatted output then uses four spaces for each nested level. Minify sets the spacing to zero.
Can I sort JSON keys and keep array order?
Select Sort keys to sort object keys recursively. Array items stay in their original order.
Does the JSON validator check a JSON Schema?
This page checks syntax and formats parsed JSON. Use JSON Schema Validator when a schema must be applied to the document.