JSON to Python Dict / List

Converts a JSON object or array into a Python dict / list literal. null becomes None, true → True, false → False. Nothing leaves your browser.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
JSON input
0 lines · 0 charsJSON
Python output
Ctrl/Cmd+Shift+C
0 charsPython

About This Tool

Takes a JSON value and renders it as Python source: a dict or list literal with the same structure, spelled the Python way: null → None, true/false → True/False. Paste the result directly into a script or REPL.

Produces a literal value, not a schema. If you need Python type definitions that describe the shape of the data, use JSON to Python (@dataclass / TypedDict) instead.

Key Features

  • Live conversion: Output updates as you type, plus Convert button and Ctrl/Cmd+Enter.
  • File upload: Load a .json or .txt file via the Upload button.
  • One-click swap: The swap button sends the current output to Python Dict / List to JSON as prefilled input.
  • Python-formatted output: 4-space indent and trailing commas, matching standard Python style.
  • Download as .py: Save the rendered literal directly to a file.

Frequently Asked Questions

What is the difference between this and JSON to Python Dataclass?
This tool outputs a ready-to-use value as Python source: a dict or list literal you can paste directly into code. The JSON to Python tool generates type definitions (@dataclass / TypedDict) that describe the shape of the data rather than hold it.
Can I go the other direction (Python dict back to JSON)?
Yes: use the Python Dict / List to JSON tool.
Does it handle nested objects and arrays?
Yes, arbitrarily deep nesting is supported.