DevToolsHub Free · Fast · 100% in your browser

JSON to TypeScript, Zod and Python

Generate TypeScript interfaces, Zod schemas or Python classes from JSON.

About this JSON to TypeScript converter

Generate TypeScript interfaces, Zod schemas, Pydantic models or Python dataclasses from any JSON sample. Nested objects become their own types, arrays of objects are merged so that keys missing from some items become optional, and mixed values become union types.

How to use the JSON to TypeScript, Zod and Python

  1. Paste a JSON sample.
  2. Choose TypeScript, Zod, Pydantic or dataclass output.
  3. Copy the generated types.

Example

{"id":1,"tags":["a"]}  →  export interface Root { id: number; tags: string[]; }

Frequently asked questions

How are null values handled?

Null values produce a nullable type (T | null, .nullable() or Optional[T]); enable the option to also mark them optional.

Does it support Zod?

Yes. Zod output includes z.object schemas for every nested type plus an inferred TypeScript type for each.

Is my data safe?

Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.

Is it free?

Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.

An unhandled error has occurred. Reload ✕