JSON to Classes Generator
Generate C#, TypeScript, Java, Python and Go classes from JSON, with the original names preserved.
ConvertersWhy a generator
When an interface responds in JSON, sooner or later that JSON has to be read
by a program: a class in C#, an interface in TypeScript, a dataclass in Python.
Writing them by hand is mechanical and treacherous, because the mistake is
never in the structure — which you copy — but in the details: a property whose
case changes, a field called full_name in the original that would
become FullName in your language. A generator does the boring work
and does not get distracted.
What is kept and what is adapted
Class and member names follow the conventions of the target language:
PascalCase for C#, camelCase for Java fields, snake_case where that is the
custom. The original JSON names are never lost: C# annotates them with
JsonPropertyName, Java with JsonProperty, Go puts
them in the json tags, Python keeps them in the comment next to
the field. The result deserializes the original JSON as it is.
Arrays with different elements
It happens that the elements of an array do not all have the same shape: a field exists only in some, or a number is an integer in one element and a decimal in another. The tool merges the elements into a single class: properties present only in some become optional, and types widen to the most general one that contains them all. It is the only honest reconstruction possible when shapes differ.
Your data never leaves the browser
Like every tool on this site, the conversion happens entirely on your own machine. The JSON you paste — which may contain responses from internal systems or customer data — is never sent to a server, never stored and never written to any log.
Frequently asked questions
Yes. When the generated name differs from the JSON one, the generator adds what is needed to keep the mapping exact: JsonPropertyName in C#, JsonProperty in Java, the json tag in Go, a comment in Python. Names that are already valid are left as they are.
The elements are merged into a single class: fields present everywhere become required, those present only in some become optional, and numeric types widen to the most general one. It is the same criterion a person would apply, applied consistently.
No. Generation happens entirely in your browser: the content never leaves your computer and is not stored anywhere.