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 try: with open('data.json', 'r') as file: data = json.load(file) print("File data =", data) except FileNotFoundError: print("Error: The file 'data.json' was not found.")
Published ย  September 15, 2025
Discussions

python - Loading and parsing a JSON file with multiple JSON objects - Stack Overflow
I am trying to load and parse a JSON file in Python. But I'm stuck trying to load the file: import json json_data = open('file') data = json.load(json_data) Yields: ValueError: Extra data: line 2 More on stackoverflow.com
๐ŸŒ stackoverflow.com
How do I open or even find a json file?
You store python objects in a file and retrieve the objects from a file using the json module. This tutorial shows you the basics, and you can search for other tutorials. The python doc is here . More on reddit.com
๐ŸŒ r/learnpython
23
0
June 26, 2024
On read of JSON file it loads the entire JSON into memory.
You can't really, given that structure. Because you have the surrounding list/array, the parser can't output anything until it finds the end of that array, which is at the end of the file. You might consider using json-lines format (also known as newline-delimited JSON ), in which each line is a separate JSON document so they can be loaded individually. More on reddit.com
๐ŸŒ r/learnpython
7
2
July 19, 2022
Handling JSON files with ease in Python
Looks good. Considered discussing dataclasses/pydantic with json? I found that these go well together More on reddit.com
๐ŸŒ r/Python
55
421
May 29, 2022
๐ŸŒ
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).
๐ŸŒ
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.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
JSON encoder and decoder โ€” Python 3.14.3 documentation
3 weeks ago - 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)ยถ
๐ŸŒ
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.
๐ŸŒ
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 ...
Find elsewhere
๐ŸŒ
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
Usually, in real life, you are not going to need to parse JSON from within a python script. You will need to parse it from an external json file. So let's look at the following example. with open('example.json') as f: data = json.load(f)
๐ŸŒ
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)
๐ŸŒ
Zyte
zyte.com โ€บ home โ€บ blog โ€บ json parsing with python [practical guide]
A Practical Guide to JSON Parsing with Python
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.
๐ŸŒ
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'] # }
๐ŸŒ
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
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ how do i open or even find a json file?
r/learnpython on Reddit: How do I open or even find a json file?
June 26, 2024 -

I'm making a text based rpg in python and i learnt that the data can be saved to a json file and then can be read from it and used. But how do I access that json file? Or maybe i should do another method to save game? Also is there a way to open a json file in python so that python can read it's values?

๐ŸŒ
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:
๐ŸŒ
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.
๐ŸŒ
Dive into Python
diveintopython.org โ€บ home โ€บ learn python programming โ€บ file handling and file operations โ€บ operations with json files
JSON with Python - Read, Write, Print and Parse JSON Files with Examples
May 3, 2024 - This example shows how to open JSON file in Python and work with it. The json module in Python offers various functions to handle JSON data efficiently. json.load(): This function loads JSON data from a file-like object and converts it into a Python object.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ pandas โ€บ pandas_json.asp
Pandas Read JSON
In our examples we will be using a JSON file called 'data.json'. Open data.json. ... Tip: use to_string() to print the entire DataFrame. ... JSON objects have the same format as Python dictionaries.