json.dumps() converts a dictionary to str object, not a json(dict) object! So you have to load your str into a dict to use it by using json.loads() method

See json.dumps() as a save method and json.loads() as a retrieve method.

This is the code sample which might help you understand it more:

import json

r = {'is_claimed': 'True', 'rating': 3.5}
r = json.dumps(r)
loaded_r = json.loads(r)
loaded_r['rating'] #Output 3.5
type(r) #Output str
type(loaded_r) #Output dict
Answer from Iman Mirzadeh on Stack Overflow
🌐
dict2json
dict2json.com
Python Dict to JSON Converter Online | dict2json
Paste your Python dictionary to convert it to valid JSON format instantly
Discussions

convert JSON list to dictionary
Your json seem to be a list containing to objects (that could be described as students I guess) - file.json [ { "Name": "Steel", "StudentID": 3458274, "Tuition": 24.99 }, { "Name": "Joe", "StudentID": 5927592, "Tuition": 14.99 } ] with open('file.json', mode='r') as f: data = json.load(f) data variable now contains the content of the json file as a python list of dicts Edit: Also, I noticed that your json missing some commas (as is in your post) so it will come out as invalid and your python program gonna crash trying to parse it More on reddit.com
🌐 r/learnpython
8
0
January 13, 2024
What's the real difference between a dict and a JSON object (coming from JS background)
JSON is a file format that uses a key - value pair syntax. Keys can only be unicode strings surrounded by doubel quotes, like "name". Values can be: Only certain number formats like 5, -5, 5.5, 1.0E+5 The values true, false, and null Unicode strings in double quotes, like "hello" Array: an ordered, comma separated list of any valid value type Object: a collection of key-value pairs that itself confirms to the JSON syntax ---------------------------------- A Python dict is an object that can have any hashable object as a key. It’s more flexible. A number, a decimal, a string, a tuple, etc can be a key. A Python dict value has no limits (that I know of). It can be any Python object. A string, a number, a function, another dict, a whole entire module. You name it. ---------------------------------- What makes JSON so powerful is that it's an agreed upon format. No matter if you're using Python, Java, PHP, or Ruby, if someone sends your app data in the JSON format, the shape is predictable so your programming language of choice will be able to parse it. How Java, Python, JavaScript, etc. decide to parse JSON into an object will be a little different depending on the language. Python can decode a string or file that confirms to the JSON format into a Python dict. ---------------------------------- One nuance that I wanted to point out is even though JSON stands for "JavaScript Object Notation", it is NOT JavaScript. JSON is a file format/data exchange format. Someone said "So 1 and 1.0 are two different values in Python, while in JSON, they would be the same." That's not quite true. JSON is only a format. 1 and 1.0 in a json file are no more "the same" as 1 and 1.0 are in a txt file. What that person probably meant is that 1 and 1.0 are the same in JavaScript, but that's besides the point because it's important to remember that JSON is NOT JavaScript, it's a format. More on reddit.com
🌐 r/learnpython
10
3
October 9, 2022
convert list of dictionary to list of json objects
Json.dumps will convert the dictionary to a string but the string is valid JSON. You see the single quotes since Python is indicating this is a string (and double quotes is being used internally). More on reddit.com
🌐 r/learnpython
7
2
October 13, 2022
How to append an dictionary into a json file?
Your problem is not appending strings/jsons to a file. Your problem is later on reading it. json files usually hold ONE json object, not many concatenated objects. You can create a list, and have you dictionaries be items in that list, and then append to it, and dump the entire list as JSON to have multiple dictionaries stored, but eventually its one JSON object. If you want to modify/append a json object in a file, you read it first, load/loads, change it however you want, and write it back. # load it with open("index.json" , "r") as json_file: file_data = json.loads(json_file.read()) # change it file_data.append(dict) # write it all back with open("index.json" , "w") as json_file: json_file.write(json.dumps(file_data)) (Obviously above code assumes you already have a list dumped as a json object in index.json) More on reddit.com
🌐 r/learnpython
2
1
September 2, 2023
People also ask

What is the difference between Python dict and JSON?
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.
🌐
dev-workshop.marco79423.net
dev-workshop.marco79423.net › paji dev workshop › python dict to json converter
Free Online Python Dict to JSON Converter Tool - Convert Dict to ...
How is Python dict syntax different from JSON?
Python uses True, False, and None where JSON uses true, false, and null. Python allows single or double quotes; JSON requires double quotes only. JSON does not support comments or trailing commas.
🌐
dict2json.com
dict2json.com
Python Dict to JSON Converter Online | dict2json
What is a Python dictionary?
A Python dictionary is a built-in data structure that stores key-value pairs. Keys must be unique and immutable; values can be any type, including other dictionaries. Dictionaries are mutable and preserve insertion order in Python 3.7+.
🌐
dict2json.com
dict2json.com
Python Dict to JSON Converter Online | dict2json
🌐
KDnuggets
kdnuggets.com › convert-python-dict-to-json-a-tutorial-for-beginners
Convert Python Dict to JSON: A Tutorial for Beginners - KDnuggets
The dumps function has several optional parameters. We’ve already used one such optional parameter indent. Another useful parameter is sort_keys. This is especially helpful when you need to sort the keys of the Python dictionary when converting it to JSON
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-convert-python-dictionary-to-json
How To Convert Python Dictionary To JSON? - GeeksforGeeks
July 12, 2025 - json.dump() writes a dictionary directly into a file in JSON format. It avoids the need to manually open and write the JSON string to a file. Additional options like indentation and key sorting can be applied to make the output more structured.
🌐
Board Infinity
boardinfinity.com › blog › dict-to-json-in-python
Dictionary to JSON: Conversion in Python | Board Infinity
June 16, 2026 - Serialization of Unsupported Types: Error: The error message is often as - "TypeError: Object of type X is not JSON serializable" Solution: Include the default parameter in json.dumps() so as to handle instances of custom types. Circular References: Objects with reference to objects containing them can lead to the creation of endless circles during serialization. Do not organize your code in such structures as flattened or refactored. Encoding and Decoding Issues: It is recommended to enforce always creating a new encoding/decoding to support internationalization, for instance, UTF-8. Python dict to JSON is crucial for any Python developer, especially when handling APIs, data and storage systems, or distributed systems.
Find elsewhere
🌐
FavTutor
favtutor.com › blogs › dict-to-json-python
5 Ways to Convert Dictionary to JSON in Python | FavTutor
October 5, 2021 - Python possesses a default module, ‘json,’ with an in-built function named dumps() to convert the dictionary into a JSON object by importing the "json" module. "json" module makes it easy to parse the JSON strings which contain the JSON object.
🌐
Python Examples
pythonexamples.org › python-dict-to-json
Python Dictionary to JSON
To convert a Dict to JSON in Python, you can use json.dumps() function.
🌐
JSON Reader
jsonreader.com › home › python dict to json
Python Dict to JSON Converter Online
Paste a Python dict and get valid JSON — with True/False/None and single quotes converted automatically — free and private in your browser. ... Paste your JSON into the editor, or upload / drag-and-drop a .json file.
🌐
Paji Dev Workshop
dev-workshop.marco79423.net › paji dev workshop › python dict to json converter
Free Online Python Dict to JSON Converter Tool - Convert Dict to JSON - Paji Dev Workshop
Convert your Python dict to JSON format using this free online converter with various advanced options. Paste your Python dictionary literal (using curly braces or dict() syntax) and instantly get clean, formatted JSON output.
🌐
Analytics Vidhya
analyticsvidhya.com › home › how to convert python dictionary to json?
How To Convert Python Dictionary To JSON? - Analytics Vidhya
January 11, 2024 - The json.dumps() function conveniently transforms a Python dictionary into a JSON-formatted string. It allows customization, such as specifying indentation and sorting, tailoring the conversion process to specific needs.
🌐
Medium
medium.com › @techclaw › python-dict-to-json-simplifying-data-serialization-81a8d4eeb512
Python Dict to JSON: Simplifying Data Serialization | by TechClaw | Medium
October 12, 2023 - Save data to a file for later use. Share data with other applications that understand JSON. Python dictionaries are not directly compatible with JSON, so conversion is required.
🌐
Scaler
scaler.com › home › topics › convert dictionary to json python
Convert Dictionary to JSON Python - Scaler Topics
April 21, 2024 - With the help of the JSON python module, we can work with JSON objects including parsing, serializing, deserializing, and many more. It also enables us to convert the dict to JSON python and work on it efficiently.
🌐
iO Flood
ioflood.com › blog › python-dict-to-json
Convert a Python Dict to JSON | json.dumps() User Guide
January 30, 2024 - Using the json.dumps() function, we convert this dictionary into a JSON object, json_data, which we then print. The output is a JSON-formatted string. Intrigued? Keep reading for a more detailed walkthrough and exploration of advanced scenarios ...
🌐
AskPython
askpython.com › python › dictionary › convert-dictionary-to-json
How to convert Dictionary into JSON in Python? - AskPython
July 27, 2022 - dumps() method allows us to convert a python object (in this case dictionary) into an equivalent JSON object.
🌐
CodeItBro
codeitbro.com › home › all tools › development tools › json tools › python dict to json online
Python Dict to JSON Converter: Transform Dict to JSON
June 28, 2026 - Paste your Python dictionary string into the input editor. ... JSON output is generated automatically as you type. ... Copy the JSON result or download it as a .json file. ... It converts single quotes to double quotes, True→true, False→false, ...
🌐
Code Beautify
codebeautify.org › blog › convert-python-dictionary-to-json
Convert Python Dictionary to Json
January 20, 2023 - Users can use the JSON module of Python to save a dictionary as a JSON file.
🌐
TechBeamers
techbeamers.com › python-dictionary-to-json
Python Dictionary to JSON - TechBeamers
November 30, 2025 - Python provides the built-in json module for working with JSON data. The most basic method in this module is json.dumps(data) for encoding and decoding JSON data. The following Python code puts forth the simple steps to convert a dictionary to JSON.
🌐
Python
docs.python.org › 3 › library › json.html
JSON encoder and decoder — Python 3.14.7 documentation
Keys in key/value pairs of JSON are always of the type str. When a dictionary is converted into JSON, all the keys of the dictionary are converted to strings. As a result of this, if a dictionary is converted into JSON and then back into a dictionary, the dictionary may not equal the original one.
🌐
GeeksforGeeks
geeksforgeeks.org › python › convert-json-to-dictionary-in-python
Convert JSON to dictionary in Python - GeeksforGeeks
July 12, 2025 - In the below code, firstly we open the "data.json" file using file handling in Python and then convert the file to Python object using the json.load() method we have also print the type of data after conversion and print the dictionary.