Python Dict to JSON Converter
Convert a Python dictionary or list literal into valid JSON text. Single quotes become double quotes, and True, False and None become true, false and null.
1 Paste your text and pick the options
2 Your answer
Your answer shows here as you type.
How to use the Python Dict to JSON Converter
- Paste a Python dict or list into the box, with single or double quotes.
- Choose the indent size for the JSON output.
- Copy the JSON text from the result. A leading variable name such as data = is ignored.
Frequently asked questions
What is the difference between a Python dict and JSON?
A Python dict accepts single or double quotes, True, False and None, tuples and comments. JSON allows only double-quoted strings and the words true, false and null.
How are Python tuples and lists converted?
Both become JSON arrays. Sets, bytes and custom objects have no JSON form, so this converter rejects them.
Does the converter keep the key order?
Yes. Keys stay in the order they were written, including numeric-looking keys such as 10 and 2, which JSON parsers may reorder.
Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.