JSON Payload Generator
Processed Client SideDefine 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.
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
- Choose whether the root is an object or an array of objects.
- Add your first key, pick its datatype, and type a sample value.
- For an object, add child fields inside it; for an array, define the element shape and set how many elements you want.
- Reorder keys by dragging, and use the tree view with search to check a large payload.
- 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.