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
... 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
๐ŸŒ
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.
๐ŸŒ
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 - import json # Your data user_data = { "name": "Alice Smith", "age": 28, "email": "alice@example.com", "interests": ["coding", "hiking", "photography"] } # Save to file with open("user_data.json", "w") as file: json.dump(user_data, file) Whatโ€™s happening here? - `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']
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ reading-and-writing-json-to-a-file-in-python
Reading and Writing JSON to a File in Python - GeeksforGeeks
Python offers two main ways to ... File pointer: A file pointer that points to a JSON file. Example: Read a JSON file and convert its contents to a Python ......
Published ย  August 5, 2025
๐ŸŒ
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)ยถ
๐ŸŒ
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)
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.
๐ŸŒ
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']}, ...
๐ŸŒ
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 - Different languages and technologies can read and parse JSON files in different ways. In this article, we've learned how to read JSON files and parse such files using the read method of file objects, and the loads and load methods of the json module.
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ python โ€บ json module โ€บ .load()
Python | JSON Module | .load() | Codecademy
May 29, 2025 - The method automatically handles the file parsing and returns a dictionary that can be accessed using standard Python syntax. This example shows how to use json.load() to process application configuration files, a common real-world use case: ... This example demonstrates loading application settings from a JSON configuration file.
๐ŸŒ
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 - For example, we can call dictionary methods, add, update, and remove key-value pairs, and more. We can even use it in a for loop. When you use loads() to create a Python dictionary from a JSON string, you will notice that some values will be ...
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-read-json-file-in-python
How to read JSON file in Python
Example 1: { "fruit": "Apple", "size": "Large", "color": "Red" } Example 2: { 'name': 'Karan', 'languages': ['English', 'French'] } ... Python has an in-built package called json which can be used to work with JSON data and to read JSON files. The json module has many functions among which ...
๐ŸŒ
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).
๐ŸŒ
Zyte
zyte.com โ€บ home โ€บ blog โ€บ json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
July 6, 2023 - Following, we display an example using the load method. Given a JSON file: ... 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.
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ python-how-to-load-json-from-file-438170
How to load JSON from file | LabEx
graph TD A[JSON Use Cases] --> B[Web APIs] A --> C[Configuration Files] A --> D[Data Storage] A --> E[Data Exchange] ... By understanding these fundamentals, you'll be well-prepared to work with JSON in Python and other programming contexts. LabEx recommends practicing these concepts to gain proficiency. Python provides the built-in json module for working with JSON data. To load JSON files, you'll primarily use two methods:
๐ŸŒ
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 - In this guide, we'll take a look at how to read and write JSON data from and to a file in Python, using the json module.
๐ŸŒ
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.
๐ŸŒ
Plain English
python.plainenglish.io โ€บ how-to-read-json-files-in-python-aec189287cfe
How to Read JSON Files in Python. This article will cover how to readโ€ฆ | by Crawlbase | Python in Plain English
May 18, 2025 - ... import json try: # Attempt to open a non-existent file with open('data.json', 'r') as file: data = json.load(file) except FileNotFoundError: print("Error: The file was not found.