JSON Formatter / Minifier / ValidatorJSON Escape / UnescapeJSON DiffSort JSON KeysJSON ⇄ StringJSON ⇄ XMLXML ⇄ JSONJSON to CSVCSV to JSONJSON ⇄ YAMLJSON to CodeQuery Params ⇄ JSONCookie ⇄ JSONJSON ⇄ Properties
JSON to Code
Generate TS / Go / Java / C# / PHP type definitions from a sample JSON
How to use
Field types are inferred from the sample: objects become nested structures, arrays use the type of the first element, and null falls back to the language-appropriate generic type. Field names are capitalized automatically in Go/Java/C#.
FAQ
Is the type inference accurate?
It is based on the sample you provide. The array type is inferred only from the first element; if that field is null in the sample, it falls back to a generic type such as Object or interface{}. Complete the sample before generating.
Can it generate constructors or validation annotations?
This tool only generates plain type or class skeletons without business logic. Add annotations or methods on top of the result if you need them.