๐
JSON to Python
Developer
Convert JSON into a Python data assignment containing dictionaries, lists and scalar literals. JSON true, false and null become True, False and None. Quoted dictionary keys and nested lists are preserved.
0
0
Input
Output
Convert JSON into a Python data assignment containing dictionaries, lists and scalar literals. JSON true, false and null become True, False and None.
See moreSee less about the JSON to Python
Quoted dictionary keys and nested lists are preserved.
Examples
A Python data assignment
JSON: {"active":true,"items":[null,false]}
Python: data = {"active": True, "items": [None, False]}Output is indented Python literals, not Pydantic models, dataclasses or executable conversion logic. Limits: 100,000 characters, 10,000 values and 64 nesting levels. Unsafe integers are rejected; represent large IDs as strings.
Key features
- Python dictionaries and lists
- Boolean and null conversion
- Copy the data assignment
Related Blog Posts
Quick answers for JSON to Python
What does this tool produce?
Convert JSON into a Python data assignment containing dictionaries, lists and scalar literals. JSON true, false and null become True, False and None. Quoted dictionary keys and nested lists are preserved.
What are the limits and important options?
Output is indented Python literals, not Pydantic models, dataclasses or executable conversion logic. Limits: 100,000 characters, 10,000 values and 64 nesting levels. Unsafe integers are rejected; represent large IDs as strings.