JSON Schema → Types
Paste a JSON Schema, pick a language. Output: TypeScript types, Zod schemas with inferred types, Pydantic v2 BaseModel, Go structs with JSON tags, or Rust serde. Generated code is a starting point — review unions and recursive schemas before checking in.
Paste a JSON Schema.
How to generate types from a schema
- Paste your schema.
- Pick Output language. Per-language options appear:
- TypeScript: prefer
typevsinterface, exact types viaas const, optional vs| undefined. - Zod: include parsers, infer types, strict by default.
- Pydantic: v1 or v2, BaseModel vs dataclass, alias generators.
- Go: pointer-for-nullable, JSON tag style.
- Rust: serde with
skip_serializing_if,#[serde(rename_all)]policy.
- TypeScript: prefer
- Output appears with syntax highlighting. Copy or Download as
.ts/.py/.go/.rs.
FAQ
What about recursive schemas?
The tool emits a placeholder type with a comment. Hand-edit to use a proper recursive type definition (TypeScript / Zod recursive types, Go pointer to self, Rust Box<T>).
Why does the Pydantic output miss validators?
The tool only translates structure. Custom validators (@validator, @field_validator) come from logic outside the schema. Add them manually.
Will it work offline?
Yes — pure JavaScript.