JSON Examples

Realistic, ready-to-use JSON for users, e-commerce, API responses, maps, messaging and config files. Copy one, download it, or open it straight in the Formatter or Tree Viewer.

36 examples · 6 categories

Users & Auth

Accounts, sign-in responses, roles and settings - the objects nearly every app starts with.

user-profile.json22 lines · 542 B

User profile

A typical account object with nested address, preferences and timestamps.

{
  "id": "usr_8f3a2c",
  "username": "maya.chen",
  "email": "maya.chen@example.com",
  "displayName": "Maya Chen",
  "emailVerified": true,
  "avatarUrl": "https://cdn.example.com/avatars/usr_8f3a2c.png",
  "address": {
    "street": "42 Harbor Lane",
    "city": "Portland",
    "region": "OR",
    "postalCode": "97201",
    "country": "US"
  },
  "preferences": {
    "language": "en-US",
    "timezone": "America/Los_Angeles",
    "newsletter": false
  },
  "createdAt": "2025-03-14T09:26:53Z",
  "lastLoginAt": "2026-09-20T17:02:11Z"
}
login-response.json17 lines · 336 B

Login response with tokens

What an auth endpoint returns after a successful sign-in: tokens, expiry and a user summary.

{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfOGYzYTJjIn0.sig",
  "refreshToken": "rt_4b1d9e7a0c2f",
  "tokenType": "Bearer",
  "expiresIn": 3600,
  "scope": [
    "profile",
    "orders:read"
  ],
  "user": {
    "id": "usr_8f3a2c",
    "displayName": "Maya Chen",
    "roles": [
      "customer"
    ]
  }
}
user-list.json23 lines · 372 B

Paginated user list

An array of lightweight user records wrapped with page metadata.

{
  "page": 1,
  "pageSize": 3,
  "totalItems": 57,
  "totalPages": 19,
  "items": [
    {
      "id": "usr_8f3a2c",
      "name": "Maya Chen",
      "status": "active"
    },
    {
      "id": "usr_1d0b77",
      "name": "Tomás Rivera",
      "status": "invited"
    },
    {
      "id": "usr_c29e41",
      "name": "Aisha Bello",
      "status": "suspended"
    }
  ]
}
roles-permissions.json35 lines · 484 B

Roles and permissions

Role-based access control: each role maps to a list of allowed actions.

account-settings.json22 lines · 360 B

Account settings

Grouped user settings with booleans, enums and nested notification channels.

{
  "theme": "system",
  "twoFactor": {
    "enabled": true,
    "method": "totp"
  },
  "notifications": {
    "email": {
      "productUpdates": true,
      "weeklyDigest": false
    },
    "push": {
      "mentions": true,
      "comments": true
    },
    "sms": null
  },
  "privacy": {
    "profileVisibility": "team",
    "showOnlineStatus": false
  }
}
audit-log-entry.json25 lines · 448 B

Audit log entry

A security event recording who did what, from where, and what changed.

E-commerce

Products, carts, orders and payments, including money amounts and variant options.

product.json22 lines · 403 B

Product

A catalog item with price in minor units, images, ratings and stock status.

{
  "sku": "MUG-CER-12OZ",
  "name": "Ceramic Coffee Mug, 12 oz",
  "slug": "ceramic-coffee-mug-12oz",
  "price": {
    "amount": 1800,
    "currency": "USD"
  },
  "images": [
    "https://cdn.example.com/p/mug-front.jpg",
    "https://cdn.example.com/p/mug-side.jpg"
  ],
  "categories": [
    "kitchen",
    "drinkware"
  ],
  "rating": {
    "average": 4.6,
    "count": 312
  },
  "inStock": true
}
product-variants.json44 lines · 656 B

Product with variants

One product, several purchasable variants that differ by size and color.

shopping-cart.json27 lines · 426 B

Shopping cart

Line items, a discount code and computed totals.

order.json41 lines · 748 B

Order

A placed order with customer, shipping address, items and a status history.

payment-receipt.json18 lines · 329 B

Payment receipt

The result of a card payment: masked card details, amounts and outcome.

{
  "paymentId": "pay_3kd82m",
  "orderNumber": "ORD-2026-004817",
  "amount": 4150,
  "currency": "USD",
  "method": {
    "type": "card",
    "brand": "visa",
    "last4": "4242",
    "expMonth": 8,
    "expYear": 2029
  },
  "status": "succeeded",
  "fees": {
    "processing": 150
  },
  "createdAt": "2026-09-18T10:12:04Z"
}
inventory-update.json23 lines · 403 B

Inventory update

A batch of stock adjustments across warehouses, with a reason for each change.

{
  "batchId": "inv_batch_0921",
  "warehouse": "PDX-1",
  "adjustments": [
    {
      "sku": "MUG-CER-12OZ",
      "delta": 48,
      "reason": "restock"
    },
    {
      "sku": "TEE-M-BLK",
      "delta": -2,
      "reason": "damaged"
    },
    {
      "sku": "TEE-L-WHT",
      "delta": -1,
      "reason": "order",
      "orderNumber": "ORD-2026-004822"
    }
  ],
  "submittedBy": "usr_ops07"
}

API Responses

Envelopes, errors, pagination and webhooks - the shapes you meet when integrating with APIs.

success-envelope.json13 lines · 213 B

Success envelope

A consistent wrapper that separates the payload from request metadata.

{
  "success": true,
  "data": {
    "id": "prj_91",
    "name": "Website redesign",
    "archived": false
  },
  "meta": {
    "requestId": "req_a81c0f",
    "durationMs": 42,
    "apiVersion": "2026-06-01"
  }
}
problem-details.json9 lines · 263 B

Error response (Problem Details)

An error in the RFC 9457 "problem details" format used by many HTTP APIs.

{
  "type": "https://api.example.com/problems/insufficient-funds",
  "title": "Insufficient funds",
  "status": 402,
  "detail": "Your balance is 30.00 but the transfer requires 50.00.",
  "instance": "/transfers/trf_7781",
  "balance": 3000,
  "required": 5000
}
validation-errors.json22 lines · 453 B

Validation errors

Field-level errors returned when a submitted form or request body is invalid.

{
  "status": 422,
  "message": "The request body failed validation.",
  "errors": [
    {
      "field": "email",
      "code": "invalid_format",
      "message": "Must be a valid email address."
    },
    {
      "field": "password",
      "code": "too_short",
      "message": "Must be at least 12 characters.",
      "min": 12
    },
    {
      "field": "birthDate",
      "code": "required",
      "message": "This field is required."
    }
  ]
}
cursor-pagination.json18 lines · 282 B

Cursor-based pagination

Pagination with opaque cursors instead of page numbers - stable for changing data.

{
  "data": [
    {
      "id": "msg_1041",
      "text": "Deploy finished"
    },
    {
      "id": "msg_1040",
      "text": "Build started"
    }
  ],
  "pagination": {
    "limit": 2,
    "hasMore": true,
    "nextCursor": "eyJpZCI6Im1zZ18xMDQwIn0",
    "prevCursor": null
  }
}
webhook-event.json14 lines · 249 B

Webhook event

A signed event delivered to your endpoint, with an idempotency id and the affected object.

{
  "id": "whevt_5c2e",
  "type": "invoice.paid",
  "createdAt": "2026-09-21T08:00:12Z",
  "attempt": 1,
  "data": {
    "object": {
      "id": "inv_2210",
      "customerId": "cus_77",
      "amountPaid": 12900,
      "currency": "USD"
    }
  }
}
health-check.json20 lines · 361 B

Health check

A service status report with per-dependency checks and latency.

{
  "status": "degraded",
  "version": "3.14.2",
  "uptimeSeconds": 864215,
  "checks": {
    "database": {
      "status": "ok",
      "latencyMs": 4
    },
    "cache": {
      "status": "ok",
      "latencyMs": 1
    },
    "emailProvider": {
      "status": "failing",
      "error": "timeout after 5000ms"
    }
  },
  "checkedAt": "2026-09-21T08:05:00Z"
}

Geo & Maps

GeoJSON features and location data. Note that GeoJSON coordinates are [longitude, latitude].

geojson-point.json14 lines · 214 B

GeoJSON Point

A single location as a GeoJSON Feature with properties.

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [
      -122.6765,
      45.5231
    ]
  },
  "properties": {
    "name": "Pioneer Courthouse Square",
    "category": "landmark"
  }
}
geojson-feature-collection.json44 lines · 719 B

GeoJSON FeatureCollection

Several features in one document - the usual input for web map layers.

geojson-linestring.json29 lines · 402 B

Route as LineString

A path made of ordered coordinates, with distance and duration properties.

geojson-polygon.json34 lines · 472 B

Area as Polygon

A closed shape - the first and last coordinates are the same point.

geocoding-result.json20 lines · 434 B

Geocoding result

An address search result with structured components and a confidence score.

{
  "query": "221B Baker St, London",
  "results": [
    {
      "formattedAddress": "221B Baker Street, London NW1 6XE, United Kingdom",
      "location": {
        "lat": 51.5238,
        "lng": -0.1586
      },
      "components": {
        "streetNumber": "221B",
        "street": "Baker Street",
        "city": "London",
        "postalCode": "NW1 6XE",
        "countryCode": "GB"
      },
      "confidence": 0.97
    }
  ]
}
store-locations.json35 lines · 553 B

Store locations

Branches with coordinates, opening hours per weekday and available services.

Social & Messaging

Posts, threads, notifications and messages - deeply nested, relationship-heavy data.

post-with-comments.json35 lines · 624 B

Post with comments

A post, its author, reaction counts and a nested list of comments.

chat-thread.json32 lines · 615 B

Chat conversation

A direct-message thread with participants, read receipts and an attachment.

notifications.json29 lines · 535 B

Notification feed

Mixed notification types sharing a common shape, plus an unread count.

social-profile.json18 lines · 313 B

Public profile with stats

A public-facing profile: bio, links, follower counts and pinned content.

{
  "handle": "@mchen",
  "name": "Maya Chen",
  "bio": "Designer. Coffee. Maps.",
  "links": [
    {
      "label": "Portfolio",
      "url": "https://maya.example.com"
    }
  ],
  "stats": {
    "followers": 4821,
    "following": 311,
    "posts": 902
  },
  "verified": false,
  "pinnedPostId": "post_5304"
}
email-message.json29 lines · 547 B

Email message

An email represented as JSON: headers, recipients, body parts and attachments.

event-invite.json17 lines · 337 B

Event with RSVPs

A calendar-style event with location, time zone and attendee responses.

{
  "id": "evt_meetup_14",
  "title": "JSON & APIs Meetup",
  "start": "2026-10-08T18:30:00-07:00",
  "end": "2026-10-08T20:30:00-07:00",
  "timezone": "America/Los_Angeles",
  "location": {
    "venue": "Community Hall",
    "city": "Portland"
  },
  "capacity": 60,
  "rsvps": {
    "going": 41,
    "maybe": 9,
    "declined": 3
  }
}

Configuration

Real configuration file formats developers edit every day.

package-json.json24 lines · 419 B

package.json

A Node.js project manifest with scripts, dependencies and engine constraints.

{
  "name": "acme-dashboard",
  "version": "1.4.0",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "test": "vitest run",
    "lint": "eslint ."
  },
  "dependencies": {
    "react": "^19.1.0",
    "react-dom": "^19.1.0"
  },
  "devDependencies": {
    "vite": "^7.0.0",
    "vitest": "^3.2.0",
    "eslint": "^9.30.0"
  },
  "engines": {
    "node": ">=20"
  }
}
tsconfig.json22 lines · 336 B

tsconfig.json

TypeScript compiler options for a strict, modern project.

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "outDir": "dist",
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  },
  "include": [
    "src"
  ],
  "exclude": [
    "node_modules",
    "dist"
  ]
}
editor-settings.json10 lines · 252 B

Editor settings (settings.json)

Code-editor preferences, including language-specific overrides.

{
  "editor.fontSize": 14,
  "editor.tabSize": 2,
  "editor.formatOnSave": true,
  "files.trimTrailingWhitespace": true,
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "workbench.colorTheme": "Default Dark Modern"
}
feature-flags.json23 lines · 373 B

Feature flags

Flags with rollout percentages and targeting rules per environment.

{
  "flags": {
    "newCheckout": {
      "enabled": true,
      "rollout": 25,
      "environments": [
        "staging",
        "production"
      ]
    },
    "darkMode": {
      "enabled": true,
      "rollout": 100
    },
    "aiSummaries": {
      "enabled": false,
      "allowList": [
        "usr_8f3a2c"
      ]
    }
  },
  "updatedAt": "2026-09-15T12:00:00Z"
}
app-config.json20 lines · 388 B

Application config per environment

Shared defaults with environment-specific overrides for URLs, logging and limits.

{
  "defaults": {
    "logLevel": "info",
    "requestTimeoutMs": 10000,
    "maxUploadMb": 25
  },
  "environments": {
    "development": {
      "apiUrl": "http://localhost:8080",
      "logLevel": "debug"
    },
    "staging": {
      "apiUrl": "https://staging-api.example.com"
    },
    "production": {
      "apiUrl": "https://api.example.com",
      "maxUploadMb": 100
    }
  }
}
json-schema.json31 lines · 546 B

JSON Schema

A schema describing the user profile example - try it in the Schema Validator.

Frequently asked questions

Can I use these JSON examples in my own project?

Yes. Every example on this page was written for JSONEdit and uses fictional data, so you can copy them into tests, mocks, documentation or demos.

Why are prices written as whole numbers like 1800?

Many payment and commerce APIs store money in the smallest currency unit (cents) to avoid floating-point rounding errors. 1800 means 18.00 in the given currency.

Why do GeoJSON coordinates put longitude first?

The GeoJSON standard orders positions as [longitude, latitude]. Many other formats use latitude first, so mixing them up is a common cause of points appearing in the wrong place on a map.

Should dates in JSON be strings or numbers?

JSON has no date type. ISO 8601 strings such as "2026-09-21T08:00:12Z" are the most common choice because they are readable and sort correctly; Unix timestamps (numbers) are also used, especially in tokens.

How do I check that my own JSON is valid?

Open it in the JSON Formatter: it validates as you type, shows the parser error message, and can beautify or minify the result. To check structure as well as syntax, use the JSON Schema Validator.

What is the difference between null and a missing key?

A key set to null says "this field exists but has no value"; a missing key says nothing about it. APIs often use null to clear a value in an update, while omitting the key leaves it unchanged.