JSON to GraphQL Schema (SDL) Converter
Paste any JSON object or array and get GraphQL `type` definitions in Schema Definition Language with scalars mapped (String, Int, Float, Boolean, lists) and separate types for nested objects. Everything runs locally in your browser — your JSON is never uploaded.
How to use
- Paste or type your JSON into the input box.
- Optionally rename the root type (defaults to AutoGenerated).
- Copy the generated SDL from the output box.
Frequently asked questions
- How are numbers typed?
- Whole numbers become Int and numbers with a decimal point become Float. Adjust manually if you need a different scalar.
- What happens with null, empty arrays, or empty objects?
- They map to a custom JSON scalar (or [JSON] for empty arrays), since their type can't be inferred. A `scalar JSON` declaration is added when used.
- Are fields nullable?
- Yes. GraphQL fields are nullable by default, so no non-null (!) markers are added. Add them manually where a value is always required.
- Is my JSON sent anywhere?
- No. Conversion happens entirely in your browser; nothing is uploaded.
Related tools
JSON → TypeScript Interface
Generate TypeScript interfaces from any JSON sample — types are inferred recursively and named after each key.
JSON to Python Dataclass Converter
Turn a JSON object into Python @dataclass definitions with type hints, in your browser.
JSON to Protobuf Schema Converter (proto3)
Turn a JSON object into a proto3 .proto schema with typed fields and nested messages, in your browser.
JSON to Zod Schema Generator
Turn a JSON object into a Zod validation schema with inferred types, in your browser.
JSON to Mongoose Schema Generator
Turn a JSON object into a Mongoose schema with type-mapped paths, in your browser.
JSON Schema Generator
Paste any JSON and get a draft-07 JSON Schema that matches its shape — types inferred, formats detected, required fields filled in.