Developer & Data 5 min read • Published 2026-03-28

Formatting and Validating JSON: A Practical Developer Guide

Understand the strict RFC 8259 JSON specification, decipher cryptic syntax error messages, and cleanly convert structured datasets between JSON and CSV.

The Strict Rules of RFC 8259 JSON

JavaScript Object Notation (JSON) is the universal data format for web APIs, configuration files, and state management. However, many developers accustomed to forgiving JavaScript syntax run into syntax errors when dealing with strict JSON parsers.

Top 4 Syntax Gotchas That Break JSON Parsing

  1. Trailing Commas: Unlike JavaScript objects, JSON forbids trailing commas. {"a": 1, "b": 2,} will throw an immediate parsing error.
  2. Single Quotes: All keys and string values in JSON must be wrapped in double quotation marks ("key": "value"). Single quotes ('key': 'value') are invalid.
  3. Unquoted Keys: Object keys in JSON cannot be bare identifiers. {id: 101} is invalid; it must be {"id": 101}.
  4. Comments: Standard JSON does not support inline comments (// comment or /* comment */).

Reading Line & Column Syntax Errors

When you paste 2,000 lines of minified JSON from a server log into WebUtilities's JSON Formatter, the parser detects the precise character index where the token stream failed and points you directly to the offending line and column number.

Try the Related Tools: