Generate Go, Python, Java, C#, Rust, Zod, Kotlin, Swift and PHP types from JSON. Runs entirely in your browser, so nothing is uploaded.
6 answers to what people ask most about the JSON to Code.
When the JSON is an array of objects, a key missing from some items is marked optional. A key that is null in some items is marked nullable. Use Make all optional when your sample doesn't show every case.
Whole numbers become 64-bit integers (int64, long, i64, Long) and numbers with a decimal point become floats. If a field mixes both across items, it becomes a float.
They get the language's catch-all type: any in Go, Any in Python, Object in Java, serde_json::Value in Rust, JsonElement in Kotlin and z.unknown() in Zod. Swift gets a small JSONValue enum.
Yes. Each nested object becomes its own named type based on its key, and arrays use the singular form, so projects becomes Project. Objects with identical shapes share one type.
Field names follow each language's style, and the original key is kept with json tags, @JsonProperty, @SerialName, serde rename, CodingKeys or a Pydantic alias.
Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.
Something not working? Tell us and we'll fix it.
Report an issue