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
- Paste a JSON sample, such as an API response.
- Pick the language and set the root type name.
- Copy the generated code into your project.
What it does
- Nested objects become their own named types
- Optional fields detected across array items
- Numbers split into integers and floats where the language cares
- 13 languages from one sample
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