About JSON to Python Dict / Object
This tool converts JSON text into a valid Python dictionary/list literal — swapping true/false/null for Python's True/False/None, and intelligently choosing between single and double quotes for each string so the result is always syntactically valid, even when your text contains apostrophes or quotation marks. Paste the output straight into a Python file or a REPL. All conversion happens locally in your browser; your data is never uploaded to a server.
Why JSON Isn't Valid Python (and What Gets Fixed)
JSON and Python dictionaries look almost identical, but a few differences make raw JSON text invalid if pasted directly into Python code. JSON's booleans are lowercase true/false and its null is null, while Python capitalizes its equivalents as True, False, and None. This tool swaps those automatically. It also handles quotes intelligently: your chosen preferred style (single or double quotes) is used by default, but for any specific string that contains that quote character, the tool automatically switches to the other quote style for just that string — avoiding the need to litter your code with escape characters, and preventing the broken syntax you'd get from naively replacing every " with ' in text that contains an apostrophe.
Send Feedback
For any questions, bug reports, or feature requests, please use the form below to send us a message.