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 โ€บ json-load-in-python
json.load() in Python - GeeksforGeeks
April 3, 2026 - json.load() is a function from Python's built-in json module.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
JSON encoder and decoder โ€” Python 3.14.8 documentation
cls (a JSONDecoder subclass) โ€“ If set, a custom JSON decoder. Additional keyword arguments to load() will be passed to the constructor of cls. If None (the default), JSONDecoder is used.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
If the file does not exist, Python raises a FileNotFoundError. The except FileNotFoundError block catches the error and displays a meaningful message instead of showing a traceback. 2. Handling JSONDecodeError: A JSONDecodeError occurs when the JSON file contains invalid or improperly formatted JSON data. ... import json try: with open("data.json", "r") as file: data = json.load(file) print("File data =", data) except json.JSONDecodeError: print("Error: Invalid JSON format in the file.")
Published: July 1, 2026
๐ŸŒ
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.
Published: January 13, 2026
๐ŸŒ
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 - Never use eval() to parse JSON. Always use json.loads(): import json # DANGEROUS - Never do this!
๐ŸŒ
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 - For managing JSON files, Python has the json module. This module comes with many methods. One of which is the loads() method for parsing JSON strings.
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
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 - Python built-in module json provides the following two methods to decode JSON data. ... To parse JSON from URL or file, use json.load().
๐ŸŒ
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.
๐ŸŒ
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 ...
๐ŸŒ
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.
๐ŸŒ
Code Beautify
codebeautify.org โ€บ blog โ€บ python-load-json-from-file
Python Load Json From File
March 2, 2022 - If you are a python programmer, json.load is a handy function to load data from a json file.
๐ŸŒ
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.
๐ŸŒ
Note.nkmk.me
note.nkmk.me โ€บ home โ€บ python
Load, Parse, Serialize JSON Files and Strings in Python | note.nkmk.me
August 6, 2023 - You can use json.load() to load JSON files into Python objects, such as dictionaries.
๐ŸŒ
Zyte
zyte.com โ€บ home โ€บ blog โ€บ json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
December 3, 2024 - 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.
๐ŸŒ
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
The with statement is a python control-flow structure that simplifies the process of reading and closing the file. Note that we use the load method instead of loads because this is a file.
๐ŸŒ
Coddy.Tech
coddy.tech โ€บ learn โ€บ courses โ€บ python json โ€บ json.loads()
json.loads() โ€“ Python JSON | Coddy
September 11, 2024 - The function takes a JSON-formatted string as input and returns a corresponding Python object. ... import json json_string = '{"name": "John", "age": 30, "city": "New York"}' parsed_data = json.loads(json_string) print(type(parsed_data)) # Output: <class 'dict'> print(parsed_data) # Output: {'name': 'John', 'age': 30, 'city': 'New York'}