JSON to types

Paste a JSON response to get matching structs, records and typed interfaces.
Try
JSON response
16 lines
Inferred shape
3 types14 fieldsdepth 21 optional
Types emittedRoot, Customer, Item
string4 fields
integer2 fields
number2 fields
boolean2 fields
array2 fields
object1 field
null1 field
Optional becausea null value or a key missing from one array item
22 lines
Hand-written types drift the moment the API changes. Generate a typed client from your OpenAPI spec, models included, and regenerate it whenever the spec changes.

Compare what you unlock

  • Type inferenceOne pasted JSON body, inferred locally
  • LanguagesTypeScript, Python, Go, Java, PHP and C#
  • ValidationShape inferred from the sample
  • SDK generationNot included
  • RegenerationNot included
  • CollaborationNot included

FAQ

How is this different from guessing types off one example?
Paste a real response from an API you are consuming and get back the types you would otherwise hand-write. Nested objects are extracted into their own named models rather than being inlined, arrays are typed from their items, and fields that are absent or null in part of the sample are marked optional instead of being silently typed as required. The same tool emits TypeScript interfaces, Python Pydantic models, Go structs, Java records, PHP classes and C# records.
Does it only generate TypeScript?
No. The same JSON sample generates TypeScript interfaces, Python Pydantic models, Go structs, Java records, PHP classes or C# records — pick the target and the output changes
Why is a field marked optional when my API always returns it?
A field is marked optional when it was null in your sample, or when it was missing from at least one item in an array. If your sample was not representative, paste a larger one
Can it infer types from a JSON schema or OpenAPI file?
No — it reads a JSON value, not a schema. If you already have an OpenAPI definition, the OpenAPI visualizer and linter is the tool for that
Is my payload uploaded anywhere?
No. Inference runs entirely in your browser, so production payloads never leave the page