Developer Tool

Python Dict to JSON

Paste a Python dictionary below to inspect formatted JSON. Conversion runs in your browser.
Python
Output (JSON)
// Your JSON will appear here...
As conversões são processadas diretamente no seu navegador.

Convert Python dictionaries to valid JSON

JSON is used when Python data needs to travel between applications: browser requests, REST APIs, configuration files and databases all rely on it. A Python dictionary looks close to JSON, but it is not always valid JSON. This tool converts common Python literals into a clean JSON document.

Key differences to remember

Example

A Python value such as {'project': 'json2py', 'published': True, 'version': None} becomes {"project":"json2py","published":true,"version":null}. The formatted output is easier to inspect or copy into an API client.

When to use code instead

For production applications, use Python's built-in json.dumps(). This page is intended for quick inspection, debugging and converting small snippets. Do not paste credentials, private keys or confidential customer data into any online tool.

Read the complete Python dict to JSON guide, or go back to JSON to Python.

Copied to clipboard