What is JSON?
JSON (JavaScript Object Notation) is a language-independent text format for structured data. APIs, config files, and logs use it because it is compact and maps cleanly to objects in almost every language. JSONKitt parses it with the browser JSON.parse API, so formatting never needs a server.
JSON syntax rules
- Data is objects
{}or arrays[]. - Object keys are double-quoted strings. Trailing commas are invalid.
- Values are string, number, boolean, null, object, or array. Comments are not allowed in strict JSON.
- Strings use double quotes. Escape quotes, backslashes, and control characters.
How to format JSON online
Paste JSON into the JSON formatter, pick an indent, and click Format (Ctrl/Cmd+Enter). If the document is invalid, the JSON validator points at the line and column. Then minify, open the tree viewer, or convert to CSV, XML, or YAML.
Common JSON errors
- Single quotes around keys or strings
- Trailing comma after the last property
- Undefined, NaN, or a trailing comment from JavaScript object literals
See a realistic payload on the JSON example page.