Format JSON and understand syntax errors
JSON formatting changes whitespace around a structured value. It does not repair the meaning of your data or validate your application’s rules.
Valid JSON is stricter than JavaScript
Property names and strings need double quotes. Comments and trailing commas are not valid JSON. A JSON value can be an object, array, string, number, boolean, or null.
{"name":"Example","items":[1,2,3],"enabled":true}Format and validate
- Paste the value into JSON Formatter.
- Select two spaces, four spaces, a tab, or Minify.
- If parsing fails, check the position named in the error message.
- Look for an unclosed quote, missing comma, or mismatched bracket near that position.
- Copy or download the formatted result only after checking the values.
Formatting is not schema validation
A document can be valid JSON but invalid for your application. For example, a required field might be missing, or a date might have the wrong format. Application-specific validation must check those requirements separately.
Take care with large identifiers
JavaScript numbers cannot represent every large integer exactly. Store long account identifiers, record IDs, and other exact numeric strings as quoted strings when appropriate. A formatter that parses numbers is not a safe way to preserve an out-of-range integer unchanged.