JSON Generator

Transform text and structured data locally in your browser.

What the JSON Generator does

Press Run Tool and the output box fills with a single, formatted JSON object you can copy straight into a test or a request body. The object always has the same shape but two fields change on every run:

{
  "id": "k3f9q2p1x7a",
  "name": "Sample",
  "active": true,
  "createdAt": "2026-09-01T09:42:18.204Z"
}

id is a short random string from Math.random().toString(36), name is always "Sample", active is always true, and createdAt is the moment you clicked, formatted as an ISO 8601 timestamp with new Date().toISOString(). The output is indented with two spaces.

When to use it

This is a fast way to get a valid, realistic-looking object when you are wiring up an API stub, seeding a mock server, writing a fixture for a unit test, checking that your JSON parser or pretty-printer handles a nested timestamp string, or demonstrating a request in documentation. Because createdAt is a real current timestamp, it is also handy for testing date parsing and time-zone handling.

Worked example

You need a POST body for a "create item" endpoint. Click Run Tool, then Copy, and paste:

curl -X POST https://api.example.com/items \
  -H "Content-Type: application/json" \
  -d '{"id":"9qz2m4k7p1a","name":"Sample","active":true,"createdAt":"2026-09-01T09:42:18.204Z"}'

Rename fields or add your own by editing the object before you use it.

Extending the object

The generator gives you a starting point, not a schema engine. To build larger structures, generate one object, paste it into the Online JSON Editor, and add arrays or nested objects there with formatting and validation as you go. To turn a finished object into a table, use JSON to CSV.

Can I control the fields or their values?

Not from this page. The shape is fixed; only id and createdAt vary. Edit the result by hand for anything else.

Why is the input box ignored?

In generate mode the object is created from nothing, so input is not read. That box serves the tool's other modes.

Is the id safe to use as a database key?

For throwaway test data, yes. For production identifiers use the UUID Generator, which produces RFC 4122 UUIDs.

Does anything leave my browser?

No. The object is generated locally in JavaScript and nothing is uploaded.