JSONGenerator
GeneratorSchemaConvertersExamplesDocs

JSONGenerator

Free online tools for generating random JSON data and JSON Schemas.

Quick Links

  • JSON Generator
  • JSON Schema Converter
  • JSON from Schema
  • Examples
  • Docs
  • Blog
  • About
  • Contact
  • Privacy Policy

Converters

  • JSON to YAML
  • YAML to JSON
  • XML to JSON
  • JSON to XML
  • JSON to TOML
  • TOML to JSON
  • JSON to CSV
  • CSV to JSON
  • JSON to Excel
  • Excel to JSON
  • JSON to HTML table
  • JSON to TypeScript
  • JSON to C#
  • JSON to Go
  • JSON to Java
  • JSON to SQL

Support

Having issues? Contact us.

© 2026 JSON Generator. All rights reserved.

JSON Generator from Schema

Paste a JSON Schema and generate realistic sample JSON that matches it.

JSON to SchemaJSON to Schema

JSON Schema

Paste or write a JSON Schema (draft-04 to 2020-12).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "User",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "firstName": {
      "type": "string",
      "minLength": 1
    },
    "lastName": {
      "type": "string",
      "minLength": 1
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "phone": {
      "type": "string"
    },
    "age": {
      "type": "integer",
      "minimum": 18,
      "maximum": 99
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "invited",
        "suspended"
      ]
    },
    "isVerified": {
      "type": "boolean"
    },
    "website": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "address": {
      "$ref": "#/$defs/address"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "maxItems": 4,
      "uniqueItems": true
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "firstName",
    "lastName",
    "email",
    "status",
    "address",
    "createdAt"
  ],
  "$defs": {
    "address": {
      "type": "object",
      "properties": {
        "street": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string",
          "pattern": "^[0-9]{5}$"
        },
        "country": {
          "type": "string"
        }
      },
      "required": [
        "street",
        "city",
        "country"
      ]
    }
  }
}

Sample JSON

Mock data generated from your schema.

1

Generating…

Generate sample JSON from a JSON Schema

This free JSON generator from schema turns a JSON Schema into realistic sample JSON. Paste the schema for an API request, a webhook payload or a config file, and you get mock data that follows it: the right types, every required field, values inside your ranges, and strings that look like real emails, names, URLs and dates rather than "string". It is a JSON Schema mock data generator that needs no install and no sign-up, and it runs in your browser.

It is the reverse of the JSON Schema Generator, which builds a schema from sample JSON. If you don't have a schema yet and just want test data, the template-based JSON Generator gives you full control over every field.

How to generate JSON from a schema online

  1. Paste your schema into the JSON Schema editor. The editor starts with a sample user schema you can edit or replace.
  2. The Sample JSON output updates as you type. If the schema isn't valid JSON, the status bar says why.
  3. Choose how many Samples to generate: one object, or an array of up to 50 items. Tick Required fields only for a minimal payload.
  4. Click Regenerate for fresh random values, then copy the result or download it as JSON, CSV or YAML.

Example: JSON Schema to sample JSON

Formats and enums decide most values; property names fill in the rest. Optional fields such as seats and tags are included unless you ask for required fields only.

JSON Schema
{
  "type": "object",
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "email": { "type": "string", "format": "email" },
    "plan": { "enum": ["free", "pro", "team"] },
    "seats": { "type": "integer", "minimum": 1, "maximum": 50 },
    "tags": {
      "type": "array",
      "items": { "type": "string" },
      "maxItems": 3
    }
  },
  "required": ["id", "email", "plan"]
}
Generated JSON
{
  "id": "0b6f2c1e-5d4a-4f7e-9a63-2c8e1d7f4b90",
  "email": "Marisa.Kling@hotmail.com",
  "plan": "pro",
  "seats": 12,
  "tags": [
    "harbor",
    "violin"
  ]
}

How each keyword is used

JSON Schema keywords and how the generator uses them
KeywordWhat the generator does
typePicks the type; with a list such as ["string", "null"] it is occasionally null.
properties, requiredFills every property, or only the required ones when that option is ticked.
items, prefixItemsGenerates list items, or each position of a tuple.
minItems, maxItemsArrays get 1 to 5 items unless you set bounds; never more than 100.
enum, const, default, examplesUsed as given: a random enum value, the const, an example or the default.
formatemail, uri, uuid, date, date-time, time, ipv4, ipv6 and hostname get valid values.
minimum, maximum, multipleOfNumbers stay in range, honour exclusive bounds and land on the multiple.
minLength, maxLength, patternStrings fit the length; simple regex patterns are matched exactly.
oneOf, anyOf, allOfoneOf and anyOf pick one branch; allOf merges every branch into one object.
$refFollows #/definitions and #/$defs references, with a guard for recursive schemas.

Why generate mock data from a schema?

  • Mock APIs before the backend exists: Serve generated payloads from a mock server so front-end work can start against the agreed contract.
  • Test fixtures that match the contract: Seed unit and integration tests with data that already passes your schema validation.
  • Check a schema says what you meant: Seeing concrete data is the quickest way to spot a missing required field or a too-loose type.
  • Documentation examples: Drop a realistic example into an OpenAPI spec, README or API reference.

Limits worth knowing: only local references (#/...) are followed, so a $ref to another file or URL is skipped; complex patterns with lookaheads or back-references fall back to a plain string; and if/then/else, not and patternProperties are ignored. Need ready-made data instead? Browse the example templates.

Frequently Asked Questions

How do I generate sample JSON from a JSON Schema?

Paste your JSON Schema into the JSON Schema editor. Sample JSON that matches it appears on the right as you type. Click Regenerate for new random values, choose how many samples you want, then copy the result or download it as JSON, CSV or YAML.

Which JSON Schema drafts are supported?

Draft-04, draft-06, draft-07, 2019-09 and 2020-12. The generator reads the keywords those drafts share, plus both ways of writing tuples (items as an array, or prefixItems) and both forms of exclusiveMinimum and exclusiveMaximum.

Which keywords does the generator understand?

type (including arrays of types and null), properties, required, nested objects, items, prefixItems, minItems, maxItems, uniqueItems, enum, const, default, examples, format, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, minLength, maxLength, pattern, oneOf, anyOf, allOf, and local $ref to #/definitions or #/$defs. Keywords it doesn't know are ignored, never an error.

Why do the values look realistic instead of random strings?

Strings with a format such as email, uri, uuid, date-time or ipv4 get a valid value in that format. Strings without a format are matched by property name, so firstName gets a first name, city a city, phone a phone number and createdAt a timestamp. Numbers named age, price or rating get sensible ranges too, always inside your minimum and maximum.

Does it handle recursive schemas?

Yes. A $ref that points back to itself, such as a tree node with children, is expanded a couple of levels deep and then stopped: optional links are left out and recursive arrays end up empty, so the output is always finite.

Can I generate only the required fields?

Yes. Tick Required fields only to leave out every property that isn't listed in required, at every level. By default all properties are included, which gives fuller mock data.

Is my schema uploaded to a server?

No. Generation runs entirely in your browser. Your schema is saved in your browser's local storage so it is still there next time, but it is never sent to our servers.