The converter uses a local Python dict parser rather than executing Python code. It supports curly dict literals, dict constructor syntax, strings, lists, tuples, None, True, False, inline comments, and numeric forms such as hex, binary, octal, underscores, and scientific notation.
None becomes null, True and False become lowercase JSON booleans, and tuples are converted to arrays. Comments, original quote style, and dict constructor formatting are discarded because the output is formatted JSON data.
Common questions and answers about this topic.
Python dictionaries use single or double quotes for strings, True/False for booleans, and None for null values. JSON requires double quotes, uses true/false, and null. This tool automatically handles these conversions.
This converter supports curly brace dict literals ({'key': 'value'}), dict() constructor syntax, single and double-quoted strings, nested dicts and lists, tuples (converted to arrays), None/True/False, numbers with underscore separators (1_000_000), hex/octal/binary literals, scientific notation, and inline comments (#).
Yes, you can adjust the tab width (2 or 4 spaces) or switch to tab-based indentation using the formatting options above the output panel.
Python's None is converted to JSON's null, True becomes true, and False becomes false. These are automatically mapped to their JSON equivalents during conversion.
No, the Python dict to JSON conversion happens entirely in your browser. Your dict input is parsed and transformed locally via JavaScript and never leaves your device.