JSON to Types & Schema
Nothing leaves your browser
Turn sample JSON into type definitions and validation schemas, with nested objects, optional fields and unions.
Generate from every sample, entirely in this tab. Nothing is uploaded or saved. Review inferred types before use.
Sample JSON
Tab indents. Press Escape, then Tab, to leave the editor.
Generated definitions
The result appears here.
Naming applies to definitions and Python attributes; JSON keys stay unchanged. Python aliases use Field (Pydantic) or json_key metadata (dataclasses). Dataclasses do not deserialize JSON or validate values automatically; missing Python fields also accept None. Python requires 3.10+ and Pydantic output requires v2.
Dates remain strings in TypeScript and Python; Zod and JSON Schema include ISO date constraints. JSON Schema format validation depends on your validator. Enums require at least 3 strings, repetition, and at most 8 short identifier-like values. Empty arrays infer unknown items. Additional object keys are allowed. Samples cannot establish every possible value or business rule; no generated code is executed.