/

JSON Payload Generator

Processed Client Side

Define keys, pick a datatype and a sample value for each, and instantly get a ready-to-send JSON body — with nested objects and arrays. Everything runs in your browser.

Keys
Keys
Sample value
Sample value
Sample value
Sample value
Sample value
Sample elements
items
Sample value
JSON body
5 keys
{
  "id": 1024,
  "name": "Ada Lovelace",
  "active": true,
  "address": {
    "city": "London",
    "zip": "EC1A"
  },
  "roles": [
    "admin",
    "admin"
  ]
}
JSON · ready to paste into your API request or test payload

Bookmark this tool now — skip the search next time you need it.

About JSON Payload Generator

This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.

The JSON Payload Generator builds a request body by hand without you typing a single brace. Add a key, pick its datatype, type a sample value, and the JSON appears next to it — nested objects, arrays with as many sample elements as you want, and null values included. It exists for the moment you need a plausible body to test an endpoint against and do not want to fight quoting and commas to get one: a POST body for Postman or curl, a fixture for a test, a mock response for a frontend that is waiting on a backend. The output is always valid JSON, whatever half-finished state the editor is in.

Key features

  • Key-by-key editor with a datatype selector — string, number, integer, boolean, null, object, or array
  • Nested objects and arrays to any depth, built by adding fields inside a field
  • Array element count, so one item definition can produce several sample elements at once
  • Root switch between a single object and an array of objects, for endpoints that take a batch
  • Code view and an interactive tree view, with search that filters the tree down to matching keys and values
  • Output as 2-space, 4-space, or minified JSON
  • Drag to reorder keys; the order you set is the order in the output
  • Values coerced to the type you chose, so an integer field never emits a quoted string
  • Always-valid output — blank keys are skipped and unparseable values fall back to a sensible default rather than breaking the document

How to use it

  1. Choose whether the root is an object or an array of objects.
  2. Add your first key, pick its datatype, and type a sample value.
  3. For an object, add child fields inside it; for an array, define the element shape and set how many elements you want.
  4. Reorder keys by dragging, and use the tree view with search to check a large payload.
  5. Pick your indentation, then copy the JSON into Postman, curl, or a test fixture.

Tips & common mistakes

  • Match the datatype to what the API actually expects. An id sent as "1024" instead of 1024 is the most common cause of a 400 that looks like it should have worked, and the type selector here is what prevents it.
  • Use the null type deliberately. A key present with a null value and a key that is absent entirely are different things to most validators, and only the first is what you get by choosing null.
  • Set an array count of two or three rather than one. A single-element array hides off-by-one bugs and lets a consumer accidentally treat the array as a single object.
  • The tree view search matches keys and values, which makes it the quickest way to confirm one field deep inside a large payload without scrolling through the code view.
  • Duplicate keys resolve last-one-wins, exactly as a JSON parser would. If a key seems to be ignored, check whether it appears twice.
  • Switch to minified before pasting into a shell command — a single-line body avoids quoting problems in curl.
  • This produces one hand-built example. For dozens of realistic records with coherent names, emails, and addresses, the Mock Data Generator is the better tool; to build the schema the payload must satisfy, use the JSON Schema Builder.

Related tools

Browse all 24 JSON tools

Frequently asked questions

10

Add a key, choose its datatype, and type a sample value. The JSON updates beside you as you go, and you copy it when it looks right — no braces, quotes, or commas to type.

string, number, integer, boolean, null, object, and array. Values are coerced to the type you picked, so an integer field emits 42 rather than "42".

Yes, to any depth. Set a field to object and add child fields inside it, or set it to array, define the element shape once, and choose how many sample elements to generate.

Yes. Switch the root from Object to Array and the same field definitions are emitted as array elements, which is what batch-create endpoints usually expect.

It renders the payload as a collapsible tree with a search box that filters down to matching keys and values — the quickest way to confirm one field deep inside a large body.

Yes. Fields with a blank name are skipped and a value that cannot be parsed as its type falls back to a sensible default, so the document stays valid however half-finished the editor is.

The last one wins, exactly as a JSON parser resolves duplicate keys in an object literal. If a key seems to be ignored, check whether it appears twice.

Because most APIs do. An id sent as "1024" instead of 1024 is one of the most common causes of a 400 response that looks like it should have worked.

No. Everything is generated in your browser, so test bodies containing internal identifiers or sample customer data stay on your machine.

This builds one payload whose keys and values you control exactly. The Mock Data Generator produces many realistic records — coherent names, emails, and addresses — when you need volume rather than precision.