format · validate · convert · runs locally

Parse JSON in Python

How to parse a JSON string into an object and serialize (stringify) an object back to JSON in Python. The json module is in the standard library — nothing to install. Need to clean up the JSON first? Use the formatter & validator.

Parse JSON (string → object)

import json
obj = json.loads(text)

Stringify (object → JSON string)

text = json.dumps(obj, indent=2)

Frequently asked questions

How do I parse JSON in Python?

The json module is in the standard library — nothing to install. Parse with the snippet above; the result is a native object/map you can read.

How do I pretty-print JSON in Python?

Use the stringify snippet above with indentation, or paste your JSON into the formatter on this page.