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

import 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
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
JSON encoder and decoder โ€” Python 3.14.3 documentation
Identical to load(), but instead of a file-like object, deserialize s (a str, bytes or bytearray instance containing a JSON document) to a Python object using this conversion table.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_json.asp
Python JSON
import json # some JSON: x = '{ ... ยท If you have a Python object, you can convert it into a JSON string by using the json.dumps() method....
๐ŸŒ
Real Python
realpython.com โ€บ python-json
Working With JSON Data in Python โ€“ Real Python
August 20, 2025 - You can use the json.load() function to deserialize JSON data from a file into a Python object.
๐ŸŒ
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 - Also notice how null from the JSON is converted to None in python. 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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
... import json with open('data.json', 'r') as file: data = json.load(file) print(json.dumps(data, indent=4)) ... In this example, we are reading data from the "data.json" file, and the output retains the same structured format as the original ...
Published ย  September 15, 2025
๐ŸŒ
Imperial College London
python.pages.doc.ic.ac.uk โ€บ java โ€บ lessons โ€บ java โ€บ 10-files โ€บ 03-load.html
Python for Java Programmers > Loading JSON files
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).
Find elsewhere
๐ŸŒ
Zyte
zyte.com โ€บ home โ€บ blog โ€บ json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
July 6, 2023 - Python provides several built-in libraries for reading JSON from files, APIs, and web applications. To read JSON data, you can use the built-in json module (JSON Encoder and Decoder) in Python. The json module provides two methods, loads and load, that allow you to parse JSON strings and JSON files, respectively, to convert JSON into Python objects such as lists and dictionaries.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-load-in-python
json.load() in Python - GeeksforGeeks
August 11, 2025 - Values can be different JSON data types such as strings, numbers, booleans, arrays, or other JSON objects. json.load() function in Python is used to read a JSON file and convert it into a corresponding Python object, such as a dictionary or a list.
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python โ€บ json โ€บ python json parsing using json.load() and loads()
Python JSON Parsing using json.load() and loads()
May 14, 2021 - As we already discussed in the article, a object_pairs_hook parameter of a json.load() method is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-read-json-file-in-python
How to read JSON file in Python
Suppose we have json file named "persons.json" with contents as shown in Example 2 above. We want to open and read it using python. This can be done in following steps ? ... Read the json file using load() and put the json data into a variable. Use the data retrieved from the file or simply ...
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-read-json-file
Python Read JSON File
Following is the data.json file that we are reading in the Python program. The content is a single object with three name:value pairs. ... import json fileObject = open("data.json", "r") jsonContent = fileObject.read() aList = json.loads(jsonContent) print(aList) print(aList['a']) print(aList['b']) print(aList['c'])
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ python-read-json-file-how-to-load-json-from-a-file-and-parse-dumps
Python Read JSON File โ€“ How to Load JSON from a File and Parse Dumps
October 27, 2020 - This is a variable that we can use within the with statement to refer to the file object. ... json.load(file) creates and returns a new Python dictionary with the key-value pairs in the JSON file.
๐ŸŒ
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.
๐ŸŒ
DEV Community
dev.to โ€บ pineapple_26 โ€บ python-load-json-from-file-14i2
Python Load Json From File - DEV Community
November 20, 2025 - The json.load() function reads JSON data directly from a file object and converts it to a Python dictionary or list.
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ reading-and-writing-json-to-a-file-in-python
Reading and Writing JSON to a File in Python
April 18, 2023 - Any file-like object can be passed to the second argument of the dump() function, even if it isn't an actual file. A good example of this would be a socket, which can be opened, closed, and written to much like a file. The mapping between dictionary contents and a JSON string is straightforward, ...
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ python โ€บ json module โ€บ .load()
Python | JSON Module | .load() | Codecademy
May 29, 2025 - The .load() method in Pythonโ€™s JSON module is used to parse JSON data from a file-like object and convert it into a Python object. This method reads JSON content directly from files, such as .json files, and transforms the structured data ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-loads-in-python
json.loads() in Python - GeeksforGeeks
Explanation: json.loads(s) parses the JSON string s and converts it into a Python dict. ... Return Type: Returns a Python object such as dict, list, int, float, or str depending on the JSON content.
Published ย  June 16, 2020
๐ŸŒ
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