jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

JSON Schema → Types

TypeScript · Zod · Pydantic · Go · Rust · one page, one switch

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

  1. Paste your schema.
  2. Pick Output language. Per-language options appear:
    • TypeScript: prefer type vs interface, exact types via as 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.
  3. 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.