JSON to Python Dataclass

Paste JSON and get Python dataclasses with inferred types and nested classes.

Frequently asked questions

What does this generate?

Python @dataclass definitions matching your JSON shape — one class per nested object, with field types inferred (str, int, float, bool, list[...]).

How are types decided?

From the JSON values: strings become str, whole numbers int, decimals float, true/false bool, arrays list[...]. Nulls become Any. Refine as needed for your data.

Does it handle nested objects?

Yes. Each nested object becomes its own dataclass, referenced by a field, with the leaf classes defined first so the file is valid as-is.