JSON to TypeScript

Input
Output

JSON to TypeScript, and 12 more languages

Paste a sample JSON response and get typed models for your code. TypeScript is selected here, and the same tool writes Go, Python, Java, C#, Rust, Kotlin, Swift, Dart, PHP, Zod, GraphQL and Protobuf.

How to use it

  1. Paste a JSON sample, such as an API response.
  2. Pick the language and set the root type name.
  3. Copy the generated code into your project.

What it does

Questions

Which languages are supported?
TypeScript, Go, Python, Java, C#, Rust, Kotlin, Swift, Dart, PHP, Zod, GraphQL and Protobuf: pick one from Language.
How are optional fields found?
When items in an array have different keys, keys that are missing from some items are marked optional.
Can I generate a JSON Schema instead?
Yes. The JSON Schema tool generates a schema from the same sample.

More JSON tools

Bracely has more than 60 JSON tools in one page. Related ones:

Runs entirely in your browser. Nothing you paste is uploaded. Privacy policy