JSON Validator: Validate & Lint JSON Syntax Online
Validate JSON documents with precise line and column error indicators. Explains common mistakes like trailing commas and single quotes in plain, actionable language.
JSON Structure Metrics
How to Use JSON Validator
- Paste your JSON payload into the editor above to validate against RFC 8259 specifications.
- View live validation status: valid JSON displays an instant green checkmark and structure statistics.
- If syntax errors are detected, the Error Panel highlights the exact line number, column offset, and offending token.
- Click "Repair JSON" to automatically fix common non-standard syntax flaws like trailing commas, single quotes, and missing property quotes.
- Switch to the "Tree View" tab to verify the parsed object and array hierarchy.
Practical Examples
Detecting Trailing Commas
Pinpoints trailing commas before closing braces or brackets.
{
"status": "active",
}Error: Unexpected token } at line 3, column 1
Diagnosing Single Quotes
Identifies non-compliant single quotes and provides valid double-quoted output.
{ 'key': 'value' }{
"key": "value"
}Common Mistakes & Troubleshooting
- Using single quotes instead of double quotes: RFC 8259 strictly requires double quotes for all string values and object property keys.
- Leaving trailing commas: trailing commas after the final element in an array or object are invalid in standard JSON.
- Unescaped control characters: newlines and tabs within JSON string values must be escaped as \n and \t.
Frequently Asked Questions
Why is my JSON invalid?
The most frequent causes of invalid JSON are: 1) trailing commas after the last item in an object or array, 2) single quotes instead of standard double quotes, 3) unquoted object keys, and 4) unescaped quotation marks inside string values.
Can JSON have trailing commas?
No. The official JSON standard (RFC 8259 and ECMA-404) explicitly forbids trailing commas. While JavaScript object literals and JSON5 permit them, standard JSON parsers will throw a syntax error.
What does "Unexpected token in JSON at position X" mean?
This error occurs when the JSON parser encounters a character that violates syntax rules at that zero-based byte index. Common culprits include missing colons, missing commas between properties, or unclosed quotation marks.
Are my validated payloads sent to any remote server?
Never. FormatFlow validates JSON 100% locally in your browser memory. Sensitive API credentials, customer records, and tokens never leave your machine.