Turn a JSON sample into typed models for fifteen targets, keeping field names and nesting, and saying plainly what the sample could not tell it.
Waiting for JSON
Paste an object, or an array of objects — a few representative records type the same as a few thousand.
Paste a JSON sample
Types are generated for every nested object, with field names preserved and serialisation annotations tying each one back to its JSON key.
JSON to Model runs entirely on your device — the JSON is parsed in the page and neither it nor the generated code is uploaded.
You’re on the Free plan. Compare plans
One tool with a target selector rather than fifteen near-identical pages. The inference is the hard part and it is the same inference for every language; splitting it across fifteen routes would mean fifteen copies of it, which is where the drift and the bugs would live. Each target only decides how to spell what was inferred.
A JSON sample is one observation, not a schema, and four things follow from that. JSON has one number type, so `{"price": 10}` is indistinguishable from `10.0` once parsed and typing it as an integer is a guess — the guess that breaks when the first fractional price arrives. A key absent from one record is optional; a key present but null is nullable, and they need different spellings in every language here. A field that is null everywhere carries no type at all. And one sample is not the range of values a field will ever hold.
All four are reported rather than hidden. Most generators conflate optional with nullable, emit `string` for a null-only field, and say nothing about the integer guess. Those are the three things that make generated models wrong in production.
Each target carries its own limitation note, and they are real constraints rather than apologies. Go needs a pointer to tell null from the zero value. serde treats a missing key and a null key the same unless told otherwise. Pydantic coerces by default. Swift's `CodingKeys` has to be emitted whenever a JSON key is not a valid property name, or the synthesised decoder looks for the wrong key.
Nothing here is compiled, and the output does not claim to compile. What is checked, by test, is that brackets balance, that every type referenced is declared, that declaration order satisfies the languages that read top to bottom, and that no identifier is a keyword or starts with a digit.
Because every value in the sample was a whole number, and JSON cannot tell 10 from 10.0 — they are the same value once parsed. This is warned about on every result, and it is the most common thing to fix by hand in a generated model.
Optional means the key was missing from at least one record; nullable means it was present and null. Every language here spells them differently — `omitempty` versus a pointer in Go, `serde(default)` versus `Option` in Rust, `NotRequired` versus `| None` in Python — so they are tracked separately throughout.
It is not claimed to, because no compiler for these languages ran. The tests check that brackets balance, every referenced type is declared, declaration order works for the languages that need it, and no identifier is a keyword or begins with a digit.
Because two records show which keys are always present. From one object every key looks required; from several, a key missing from one becomes optional — which is usually the truth about the API.
Because it already has its own tool in the API category, built around interfaces and unions rather than this inference. Adding a fifteenth target that duplicates it would be the repetition this tool exists to avoid.