Boneyard Tools

JSON to Python Dict Converter

Paste JSON to get a ready-to-paste Python literal. Objects become dicts, arrays become lists, and true, false and null become True, False and None.

How to convert JSON to a Python dict

  1. Paste or type your JSON into the box.
  2. Pick single or double quotes and an indent width.
  3. Copy the Python literal and paste it into your code.

Examples

Object with a list and null

{"name":"Ada","items":[1,2],"note":null}
{
  'name': 'Ada',
  'items': [
    1,
    2,
  ],
  'note': None,
}

Frequently asked questions

Is my JSON uploaded anywhere?

No. The conversion runs entirely in your browser, so your data never leaves your device.

How are true, false and null converted?

They become Python's True, False and None, which is what makes JSON not directly valid as a Python literal.

Single or double quotes for strings?

You can choose either. Single quotes are the common Python style, but double quotes are also valid.

Is the output safe to paste into code?

Yes. Backslashes, the active quote and newlines or tabs inside strings are escaped so the literal parses cleanly.

Can I parse this back with json.loads?

No. The output is a Python literal, not JSON. Use it directly in code, or use ast.literal_eval to read it.

Related tools