devpocket.dev

JSON to Code

Generate typed Go, Python, Java, Rust, C#, Kotlin, and Swift models from JSON samples.

Runs locally
Loading tool…

How to use

Paste a representative JSON object or array, enter the root type name, and choose a target language. Arrays of objects are merged, so fields missing from some elements become optional; integer and decimal samples share one numeric type.

Use the target-specific controls for Go tags and nullable pointers, Python model style, Java records or getters, and C# JSON attributes. Nested shapes become named types, while identical shapes are deduplicated. Review commented fallback types when an array mixes incompatible values.

FAQ

How are optional and nullable fields detected?

A field missing from any sampled array element is optional. A field explicitly containing null is nullable; each target maps those states to its idiomatic optional type.

What happens when an array contains mixed types?

Incompatible elements use a target-specific fallback such as interface{}, Any, JsonElement, serde_json::Value, or JSONValue, with a comment beside the generated field.

Is the pasted JSON uploaded or saved?

No. Inference runs entirely in the browser, and JSON input remains in memory only. The tool persists output options, not your sample data.

Related tools