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.

Indent:
Drop file here or click to upload (up to 5 MB)

JSON Structure Metrics

File Size
0.22 KB
222 bytes
Total Keys
8
Object keys count
Max Depth
3
Nesting levels
Objects
2
Dictionaries {}
Arrays
1
Lists []
Primitives
10
Strings, numbers, bools

How to Use JSON Validator

  1. Paste your JSON payload into the editor above to validate against RFC 8259 specifications.
  2. View live validation status: valid JSON displays an instant green checkmark and structure statistics.
  3. If syntax errors are detected, the Error Panel highlights the exact line number, column offset, and offending token.
  4. Click "Repair JSON" to automatically fix common non-standard syntax flaws like trailing commas, single quotes, and missing property quotes.
  5. 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.

Input:
{
  "status": "active",
}
Output:
Error: Unexpected token } at line 3, column 1

Diagnosing Single Quotes

Identifies non-compliant single quotes and provides valid double-quoted output.

Input:
{ 'key': 'value' }
Output:
{
  "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.