JSON to TypeScript, Java, Go, C#, Python & Kotlin

Generate TypeScript interfaces, Java POJOs, Kotlin data classes, C# classes, Go structs, Python dataclasses and Rust structs from a JSON sample.

Runs 100% in your browser. Nothing you paste is uploaded.

JSON

Code

About the JSON to Code

Paste a JSON response and get ready-to-use model classes. The generator infers a named type for every nested object, merges the shapes of array elements (fields missing in some elements become optional), distinguishes integers from decimals and marks null values as nullable.

Features

  • TypeScript interfaces
  • Java classes with Jackson and optional Lombok
  • Kotlin data classes (kotlinx.serialization)
  • C# with System.Text.Json attributes
  • Go structs with JSON tags
  • Python dataclasses
  • Rust structs with serde
  • Array shape merging and nullability

How to use it

  1. Paste a representative JSON sample.
  2. Choose the language and root type name.
  3. Copy or download the generated code.

Frequently asked questions

How accurate are the types?

Types are inferred from one sample, so provide a sample that includes optional fields and non-null values where possible. Review the result for fields like dates, which are emitted as strings.

Esc