JSON guides

Short, practical references written alongside the tools. Each one answers a question that comes up while you work with real payloads.

  1. Common JSON errors and how to fix them

    Trailing commas, single quotes, comments, unquoted keys, NaN and more: what each JSON parse error means, why it happens and how to fix it.

    4 min read

  2. JSON syntax: the complete rules

    Every rule of JSON syntax on one page: the six value types, strings and escapes, numbers, objects, arrays, whitespace and what RFC 8259 leaves open.

    3 min read

  3. How to escape JSON strings

    Which characters must be escaped in JSON strings, how to embed JSON inside JSON, how to spot double encoding, and how to escape safely in code.

    2 min read

  4. JSON to Java: records, POJOs, Jackson and Gson

    How to map JSON to Java classes: records or POJOs, Jackson and Gson annotations, optional and null fields, dates, money, unknown fields and Lombok.

    3 min read

  5. JSON to TypeScript: interfaces, types and Zod

    Turn JSON into TypeScript types: interface or type alias, optional or null fields, unknown or any, and runtime validation with Zod so data matches its type.

    3 min read

How these guides are written

Every rule here is checked against the JSON standard (RFC 8259) and every code sample was run before it was published. Where a parser or library behaves differently from the standard, the guide says so and names it.

Found a mistake or want a guide on another topic? Write to me.