Skip to content
Devkito

JSON to Code

Generate TypeScript, Zod, Go, Rust, Python, Kotlin and C# types from JSON.

Runs on your machine. Nothing you paste is uploaded.

Download freePricing

Get JSON to Code and 121 other tools. Free for 7 days, no account needed.

JSON to Code in Devkito

What it does

Paste a JSON sample and get matching type definitions in TypeScript, Zod, Go, Rust with serde, Python, Kotlin with kotlinx.serialization or C# with System.Text.Json. Nested objects become their own named types, and you choose the name of the root type.

Types are inferred from every value in the sample: fields missing from some array items become optional, nulls become nullable types, and 1.0 is treated as a float while 1 stays an integer. TypeScript can use interface or type with readonly fields, Go can use pointers for optional fields, and Python can target dataclasses or Pydantic v2.

When you would reach for it

  • Type an API response in a frontend project without writing interfaces by hand.
  • Generate a Zod schema to validate incoming data at runtime.
  • Create Go structs or Rust serde types with the right JSON tags for a third-party payload.
  • Draft Pydantic models or Kotlin data classes from a sample webhook body.

Also found by searching