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 โ€” JSON encoder and decoder
February 23, 2026 - 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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ read-json-file-using-python
Read JSON file using Python - GeeksforGeeks
We will be using Pythonโ€™s json module, which offers several methods to work with JSON data. In particular, loads() and load() are used to read JSON from strings and files, respectively.
Published ย  September 15, 2025
๐ŸŒ
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 - # data = eval(json_string) # Allows code execution # Safe - Always do this data = json.loads(json_string) When loading JSON from untrusted sources, validate the structure:
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
Medium
medium.com โ€บ @gadallah.hatem โ€บ the-difference-between-json-loads-and-json-load-2dbd30065f26
The difference between json.loads() and ...
December 15, 2024 - Feature json.loads() json.load() Input JSON string (in memory). File object or stream (on disk or in memory). Output Python object (dict, list, etc.). Python object (dict, list, etc.). Use Case Parsing JSON strings (e.g., API responses). Parsing JSON files or streams.
๐ŸŒ
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.
๐ŸŒ
Pydantic
pydantic.dev โ€บ docs โ€บ validation โ€บ latest โ€บ concepts โ€บ models
Models | Pydantic Docs
Models share many similarities with Pythonโ€™s dataclasses, but have been designed with some subtle-yet-important differences that streamline certain workflows related to validation, serialization, and JSON schema generation.
๐ŸŒ
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.
๐ŸŒ
Vertabelo Academy
academy.vertabelo.com โ€บ course โ€บ python-json โ€บ reading-json-files โ€บ reading-json-files โ€บ loading-json-file
How to Read and Write JSON Files in Python | Learn Python | Vertabelo Academy
Then we use the json.load() function to load the contents of the JSON file into memory. json.load() returns a Python dictionary: print(user) { 'first_name': 'Sophia', 'last_name': 'Johnson', 'user_name': 'sophiaaa' } Let's look at that customer ...
๐ŸŒ
Python.org
discuss.python.org โ€บ python help
How do I use Python to read multiple JSON files and export specific values to a CSV? - Python Help - Discussions on Python.org
September 7, 2022 - I am not a programmer and have no experience with Pyton, so I would really appreciate any help to solve the few remaining issues Iโ€™ll explain bellow: What I am trying to do is collect a few but same values from many .jsโ€ฆ
๐ŸŒ
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.
๐ŸŒ
Medium
medium.com โ€บ @AlexanderObregon โ€บ how-to-work-with-json-in-python-aef62d28eac4
How to Work with JSON in Python | Medium
November 2, 2024 - The json.load() function reads the JSON content from the file and parses it into a Python dictionary.
๐ŸŒ
Quora
quora.com โ€บ What-is-the-usage-of-Json-load-and-JSON-loads-in-Python
What is the usage of Json.load and JSON.loads in Python? - Quora
Answer (1 of 2): The difference is in the source of the JSON text * [code ]json.load()[/code] expects to get the text from a file-like object * [code ]json.loads()[/code] expects to get its text from a string object Assume you have a file (json.txt) with the following contents [code][ {"name"...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ json-dumps-in-python
json.dumps() in Python - GeeksforGeeks
The json.dumps() function in Python converts a Python object (such as a dictionary or list) into a JSON-formatted string.
Published ย  January 13, 2026
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-json
Python JSON - GeeksforGeeks
December 23, 2025 - Let's see an example where we convert the JSON objects to Python objects. Here, json.loads() method can be used to parse a valid JSON string and convert it into a Python Dictionary.
๐ŸŒ
Devoriales
devoriales.com โ€บ home โ€บ blog โ€บ python โ€บ tutorial โ€บ how to read and write json files in python
How to Read and Write JSON Files in Python
February 15, 2023 - The json.loads() method takes a JSON string as its argument, and returns a Python object that represents the deserialized data.
๐ŸŒ
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.