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
🌐
GeeksforGeeks
geeksforgeeks.org › python › read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
This error occurs when Python cannot locate the JSON file you are trying to read. Handling it prevents your program from crashing when the file is missing. ... import json try: with open('data.json', 'r') as file: data = json.load(file) print("File ...
Published   September 15, 2025
🌐
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.
🌐
W3Schools
w3schools.com › python › python_json.asp
Python JSON
Python has a built-in package called json, which can be used to work with JSON data. ... If you have a JSON string, you can parse it by using the json.loads() method.
🌐
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).
🌐
GeeksforGeeks
geeksforgeeks.org › python › json-load-in-python
json.load() in Python - GeeksforGeeks
August 11, 2025 - import json # Opening and reading the JSON file with open('data.json', 'r') as f: # Parsing the JSON file into a Python dictionary data = json.load(f) # Iterating over employee details for emp in data['emp_details']: print(emp)
🌐
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'] # }
🌐
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.
Find elsewhere
🌐
Python
docs.python.org › 3 › library › json.html
JSON encoder and decoder — Python 3.14.3 documentation
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)¶
🌐
Medium
medium.com › @gadallah.hatem › the-difference-between-json-loads-and-json-load-2dbd30065f26
The difference between json.loads() and json.load() in Python | by Hatem A. Gad | Medium
December 15, 2024 - Purpose: Reads JSON data from a file and converts it into a Python object. Input: A file object or any object supporting .read() method (e.g., opened file). Use Case: When you are working with JSON data stored in a file. import json # JSON file ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › json-loads-in-python
json.loads() in Python - GeeksforGeeks
json.loads() is a function from Python’s built-in json module that converts a JSON-formatted string into a corresponding Python object. It is mainly used when JSON data is received as text (for example, from APIs, files, or web responses) ...
Published   June 16, 2020
🌐
LabEx
labex.io › tutorials › python-how-to-load-json-from-file-438170
How to load JSON from file | LabEx
Python provides the built-in json module for working with JSON data. To load JSON files, you'll primarily use two methods: The json.load() method reads JSON directly from a file object:
🌐
Programiz
programiz.com › python-programming › json
Python JSON: Read, Write, Parse JSON (With Examples)
To work with JSON (string, or file containing JSON object), you can use Python's json module. You need to import the module before you can use it. ... The json module makes it easy to parse JSON strings and files containing JSON object. You can parse a JSON string using json.loads() method.
🌐
Medium
medium.com › @ryan_forrester_ › save-and-load-json-files-in-python-a-complete-guide-49a5760b8b49
Save and Load JSON Files in Python: A Complete Guide | by ryan | Medium
October 28, 2024 - - `open()` creates a file in write mode (“w”) - `json.dump()` writes the data directly to the file - The `with` statement ensures the file closes properly - Python handles the JSON conversion automatically ... # Read from file with open("user_data.json", "r") as file: loaded_data = json.load(file) print(loaded_data["name"]) # Output: Alice Smith print(loaded_data["interests"]) # Output: ['coding', 'hiking', 'photography']
🌐
PythonHow
pythonhow.com › how › load-json-data-in-python
Here is how to load JSON data in Python
with open('employees.json', 'r') as file: employees = json.load(file) ... Once the JSON data is loaded, it is converted into a Python list of dictionaries, allowing you to access and manipulate the data easily. for employee in employees: print(f"Name: {employee['name']}, Age: {employee['age']}, ...
🌐
Note.nkmk.me
note.nkmk.me › home › python
Load, Parse, Serialize JSON Files and Strings in Python | note.nkmk.me
August 6, 2023 - It is included in the standard library, so no additional installation is necessary. ... You can use json.loads() to convert JSON-formatted strings into Python objects, such as dictionaries.
🌐
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 - Understand use of json.loads() and load() to parse JSON. Read JSON encoded data from a file or string and convert it into Python dict
🌐
Zyte
zyte.com › home › blog › json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
July 6, 2023 - We load the data using the with open() context manager and json.load() to load the contents of the JSON file into a Python dictionary.