JSON to Python Dict Converter

Paste JSON and get a Python dict literal you can drop straight into your code - None, True/False and 4-space indents.

Detected: JSON
Input (auto-detected)
Convert to
💡 Pro tip: PressKto quickly search and navigate between tools

Examples & Use Cases

  • Before:

    JSON with double quotes, true, false and null - none of which Python will accept if you paste it straight into a .py file.

  • After:

    A dict literal that runs as-is, with the JSON keywords translated and the nesting indented the way Python code is normally written.

Saves a find-and-replace pass that is easy to get subtly wrong.

An API response as a Python literal
You have a sample response from the docs or from curl, and you want it inline in a script.

Frequently Asked Questions

Yes, to any depth. Nested objects become nested dicts and arrays become lists, with the indentation carried through.