Python JSON Formatter
Format JSON or Python dict-literal syntax (single quotes, True/False/None) into clean, standard JSON.
Paste JSON or a Python dict literal (with single quotes and True/False/None) below - this tool normalizes it into standard, formatted JSON.
Python dict literals use True/False/None and allow single-quoted strings - both differ from strict JSON syntax, which this tool normalizes automatically.
Why Is This Different from a Regular JSON Formatter?
Python's dict literal syntax looks almost like JSON but differs in a few ways: it allows single-quoted strings, and uses True/False/None instead of JSON's lowercase true/false/null. This tool normalizes those differences automatically.
Why Use This Tool?
Printing a Python dict (e.g. via print(my_dict)) produces this Python-flavored syntax, not strict JSON - pasting it into a standard JSON formatter would fail. This tool handles the conversion.
How to Use It
- Paste JSON or a Python dict literal.
- Click Format.
- Copy the resulting standard, formatted JSON.
Limitations
This handles standard Python dict literal syntax - Python-specific values with no JSON equivalent (like tuples, sets, or custom objects) aren't representable and will cause a parse error.