Developer Tools

JSON Schema Generator

Live

Infer a practical JSON Schema from example JSON.

About JSON Schema Generator

Infer a practical JSON Schema from example JSON. Enter example json, schema title in a purpose-built json schema generator interface designed for this subject. The example value is traversed to infer JSON Schema types, object properties, array items, and required keys. The result includes generated json schema, properties, required properties, supporting detail, and clear units or diagnostics. Results depend on the entered assumptions and rounding. Check important decisions against the original records or an authoritative source. Processing stays in your browser, and UtilityPages does not store the values you enter.

Set up JSON Schema Generator

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

This workspace updates as you edit.

Enter example json for this calculation.

Enter schema title for this calculation.

JSON Schema Generator result

Enter the values above, then calculate to see a detailed result.

How JSON Schema Generator works

The example value is traversed to infer JSON Schema types, object properties, array items, and required keys.

How it works

The example value is traversed to infer JSON Schema types, object properties, array items, and required keys. Results depend on the entered assumptions and rounding. Check important decisions against the original records or an authoritative source.

Examples

JSON Schema Generator worked example

Example input
{
    "json": "{\"name\":\"UtilityPages\",\"live\":true,\"count\":358,\"tags\":[\"tools\",\"calculators\"]}",
    "schema_title": "UtilityPages record"
}
Expected result
{
    "schema": "{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"title\": \"UtilityPages record\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"live\": {\n      \"type\": \"boolean\"\n    },\n    \"count\": {\n      \"type\": \"integer\"\n    },\n    \"tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    }\n  },\n  \"required\": [\n    \"name\",\n    \"live\",\n    \"count\",\n    \"tags\"\n  ],\n  \"additionalProperties\": false\n}",
    "property_count": 4,
    "required_count": 4
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Frequently asked questions

How does the JSON Schema Generator work?

The example value is traversed to infer JSON Schema types, object properties, array items, and required keys.

What information should I enter?

Enter example json, schema title. Use values and units from the same scenario so the result is internally consistent.

What results does this tool provide?

It reports generated json schema, properties, required properties, including intermediate context where it helps you review the answer.

What limitations should I know about?

Results depend on the entered assumptions and rounding. Check important decisions against the original records or an authoritative source.