JSON Examples & Syntax: Real Samples You Can Copy
A reference of real-world JSON examples — complete API responses, nested objects, arrays of objects, and one minimal sample per value type — with the JSON syntax rules that make them valid. Every block is copy-paste ready and links out to a live tool you can use to format, validate, or transform the example.
- One complete API-shaped example
- One sample per value type
- Mistakes vs corrected JSON
- Click any block to test it live
A Complete JSON Example
A realistic record you might see from a REST API or read from a .json file. It uses every value type, nests an address object, and embeds an array of order objects: all the shapes you will run into in real code.
Paste this into JSON Formatter to re-indent it, JSON to TypeScript to generate an interface, or JSON Flatten to turn it into dot-path keys.
Every JSON Value Type, With An Example
JSON supports six value types: string, number, boolean, null, array, and object. Below is one minimal example for each.
Strings always use double quotes.
Numbers are unquoted: int or float.
Lowercase only: true or false.
null is lowercase, never quoted.
Ordered list inside square brackets.
Key/value map inside curly braces.
Nested Object Example
Any value can itself be an object, so JSON nests as deep as you need. Common shapes are an address inside a user, settings inside a profile, or metadata inside a record.
Array of Objects Example
Arrays of objects are the standard shape returned by list endpoints: a top-level wrapper with an array of records. This is the most common JSON example you will work with day-to-day.
Common JSON Format Mistakes (And The Fix)
These four mistakes cause the vast majority of Unexpected token and Failed to parse JSON errors. Each card shows the broken JSON and the corrected version directly below it.
{ name: "Alice" }{ "name": "Alice" }{ "a": 1, }{ "a": 1 }{ "a": 1 "b": 2 }{ "a": 1, "b": 2 }{ 'a': 1 }{ "a": 1 }Hit a different error? Run your input through JSON Validator for the exact line and column, or JSON Repair to auto-fix the common cases.
JSON Syntax Rules: One-Glance Summary
- Keys must be strings wrapped in double quotes
- String values also use double quotes: never single quotes
- Numbers,
true,false, andnullare unquoted and lowercase - Objects use
{}, arrays use[] - Items are separated by commas; no trailing comma after the last one
- No comments:
//and/* */are not part of strict JSON - Files should be UTF-8 encoded
Frequently Asked Questions
What does a JSON format example look like?
The canonical shape is an outer object with double-quoted keys, mixed value types, and commas between every item except the last. The complete user-object near the top of this page is the example you will see most often across REST APIs and config files.
What's the difference between an array and an object in JSON?
Objects ({}) use named keys and have no guaranteed order. Arrays ([]) use positional items and preserve order. List endpoints typically return an object that wraps an array of objects.
How does nested JSON work?
Any value can itself be an object or an array, so JSON nests without limit. The three-level example above is a typical shape: user → address → fields.
Can a JSON example use single quotes?
No. JSON requires double quotes for keys and string values. { 'name': 'Alice' } is a JavaScript object literal, not strict JSON, and any standards-compliant parser will reject it.
What is a valid JSON file format example?
A .json file should contain a single JSON value at the top level: usually an object or array: saved as UTF-8 with no surrounding code. The complete example above is exactly what a one-record .json file would contain.
How are dates represented in a JSON example?
JSON has no native date type. The convention is an ISO-8601 string like "2026-04-27T10:15:00Z" (used in the complete example above). Some APIs use a Unix timestamp number instead: both are valid JSON.
Why does my JSON example fail to parse?
Almost every failure is one of: trailing comma, unquoted/single-quoted key, missing comma, or mismatched brace. The mistakes section above shows each one against its fix. Use JSON Validator for exact line and column.
Where can I test a JSON example live?
Paste any block above into JSON Formatter, JSON Validator, or JSON to TypeScript: every tool runs in your browser.
Try These JSON Examples Live