The json.load() method (without "s" in "load") can read a file directly:

Copyimport json

with open('strings.json') as f:
    d = json.load(f)
    print(d)

You were using the json.loads() method, which is used for string arguments only.


The error you get with json.loads is a totally different problem. In that case, there is some invalid JSON content in that file. For that, I would recommend running the file through a JSON validator.

There are also solutions for fixing JSON like for example How do I automatically fix an invalid JSON string?.

Answer from ubomb on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
In Python, the json.load() and json.loads() methods are used for deserialization. json.load() reads and parses JSON data from a file object.
Published ย  3 weeks ago
Discussions

Elegant Method in python to work with Json Files ?
Nothing could be easier. Import json filename = โ€œstuff.jsonโ€ # load from a file with open(filename) as jfile: data = json.load(jfile) Saving is like this, but open for writing and use json.dump. Lots of details here. https://realpython.com/python-json/ More on reddit.com
๐ŸŒ r/learnpython
27
5
October 11, 2025
Processing large JSON files in Python without running out memory
for me, the real take away here is JSON-lines. how did I not know about this? More on reddit.com
๐ŸŒ r/Python
42
335
March 15, 2022
How do I open or even find a json file?
You store python objects in a file and retrieve the objects from a file using the json module. This tutorial shows you the basics, and you can search for other tutorials. The python doc is here . More on reddit.com
๐ŸŒ r/learnpython
23
0
June 26, 2024
How to load a json file?
You want json.load. And you need to open the file with open. More on reddit.com
๐ŸŒ r/learnpython
3
1
November 16, 2016
๐ŸŒ
Imperial College London
python.pages.doc.ic.ac.uk โ€บ java โ€บ lessons โ€บ java โ€บ 10-files โ€บ 03-load.html
Python for Java Programmers > Loading JSON files | Department of Computing | Imperial College London
The json module allows you to easily load a JSON file into its equivalent Python object (usually a dict or list). To load your data from a JSON file, use json.load(file_object).
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
json โ€” JSON encoder and decoder
fp can now be a binary file. The input encoding should be UTF-8, UTF-16 or UTF-32. Changed in version 3.11: The default parse_int of int() now limits the maximum length of the integer string via the interpreterโ€™s integer string conversion length limitation to help avoid denial of service attacks. json.loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)ยถ
๐ŸŒ
Bobdc
bobdc.com โ€บ blog โ€บ pythonjson
Parsing JSON with Python
December 15, 2024 - #!/usr/bin/env python3 import json f = open('jsondemo.js') data = json.load(f) print(data["mydata"]["color"]) print(data["mydata"]["amount"]) # Pull something out of the middle of an array print(data["mydata"]["arrayTest"][3]) print(data["mydata"]["boolTest"]) print(data["mydata"]["nullTest"]) # Use a boolean value if data["mydata"]["boolTest"]: print("So boolean!") # Dig down into a data structure print(data["mydata"]["addressBookEntry"]["address"]["city"]) print("-- mydata properties: --") for p in data["mydata"]: print(p) print("-- list addressBookEntry property names and values: --") for p in data["mydata"]["addressBookEntry"]: print(p + ': ' + str(data["mydata"]["addressBookEntry"][p])) # Testing whether values are present.
๐ŸŒ
OneUptime
oneuptime.com โ€บ home โ€บ blog โ€บ how to read and write json files in python
How to Read and Write JSON Files in Python
January 25, 2026 - The with statement ensures the file is properly closed after reading, even if an error occurs. If you have JSON as a string (common when working with APIs), use json.loads(): import json json_string = '{"name": "Alice", "age": 30, "active": true}' # Parse JSON string to Python dict data = json.loads(json_string) print(data['name']) # Output: Alice print(data['active']) # Output: True (converted to Python bool)
Find elsewhere
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ loading-a-json-file-in-python-how-to-read-and-parse-json
Loading a JSON File in Python โ€“ How to Read and Parse JSON
July 25, 2022 - This is because null is not valid in Python. The json module also has the load method which you can use to read a file object and parse it at the same time. Using this method, you can update the previous code to this: import json with open('user.json') as user_file: parsed_json = json.load(user_file) print(parsed_json) # { # 'name': 'John', # 'age': 50, # 'is_married': False, # 'profession': None, # 'hobbies': ['travelling', 'photography'] # }
๐ŸŒ
NetworkAcademy
networkacademy.io โ€บ learning path: ccna automation (200-901) ccnaauto โ€บ data formats and data models โ€บ parsing json with python
Parsing JSON with Python | NetworkAcademy.IO
Usually, in real life, you are not going to need to parse JSON from within a python script. You will need to parse it from an external json file. So let's look at the following example. with open('example.json') as f: data = json.load(f)
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ json-data-python
Python JSON Data: A Guide With Examples | DataCamp
December 3, 2024 - This function is used to read a JSON file and parse its contents into a Python object. The load() function takes a single argument, the file object, and returns a Python object.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-load-in-python
json.load() in Python - GeeksforGeeks
April 3, 2026 - json.load() is a function from Python's built-in json module. It reads JSON data from a file and converts it into the corresponding Python object.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ processing large json files in python without running out memory
r/Python on Reddit: Processing large JSON files in Python without running out memory
March 15, 2022 - Looking to connect with fellow Python developers and make friends in the community ... On read of JSON file it loads the entire JSON into memory. ... I tested structured output from 288 LLM calls and logged every way JSON breaks.
๐ŸŒ
Leapcell
leapcell.io โ€บ blog โ€บ how-to-read-json-in-python
How to Read JSON in Python | Leapcell
July 25, 2025 - Use json.loads() to parse JSON strings into Python objects. Use json.load() to read JSON data from a file.
๐ŸŒ
Board Infinity
boardinfinity.com โ€บ blog โ€บ json-file-in-python
JSON file in Python: Read and Write | Board Infinity
January 3, 2025 - If the JSON file is an array the method will return a Python list. We believe that working with files always involves error handling. Issues can be something as simple as the file not being found, or something as complex as the content of the JSON file being read as invalid. import json try: with open('data.json', 'r') as file: data = json.load(file) print(data) except FileNotFoundError: print("The file was not found.") except json.JSONDecodeError: print("The file contains invalid JSON.")
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ reading-and-writing-json-to-a-file-in-python
Reading and Writing JSON to a File in Python - GeeksforGeeks
This process is called deserialization. Python offers two main ways to read JSON data: The JSON package has json.load() function that loads the JSON content from a JSON file into a dictionary.
Published ย  August 5, 2025
๐ŸŒ
CodeSignal
codesignal.com โ€บ learn โ€บ courses โ€บ hierarchical-and-structured-data-formats โ€บ lessons โ€บ parsing-json-files-in-python
Parsing JSON Files in Python
In this line, json.load(file) reads the JSON content from the file object file and parses it into a Python dictionary named data.
๐ŸŒ
Real Python
realpython.com โ€บ python-json
Working With JSON Data in Python โ€“ Real Python
August 20, 2025 - How can you read JSON data from a file into a Python program?Show/Hide ยท You can use the json.load() function to deserialize JSON data from a file into a Python object.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ how do i open or even find a json file?
r/learnpython on Reddit: How do I open or even find a json file?
June 26, 2024 -

I'm making a text based rpg in python and i learnt that the data can be saved to a json file and then can be read from it and used. But how do I access that json file? Or maybe i should do another method to save game? Also is there a way to open a json file in python so that python can read it's values?

๐ŸŒ
JSON Editor Online
jsoneditoronline.org
JSON Editor Online: edit JSON, format JSON, query JSON
Copy and paste your JSON file in the JSON editor, or load it from disk via the menu or via drag-and-drop. Then, you can edit the contents similar to how you use any text editor: enter new content with your keyboard, and right-click to open a ...