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
... 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
Discussions

python - Loading and parsing a JSON file with multiple JSON objects - Stack Overflow
The map(function, iterable) function ... map() python doc). And the list transforms this iterator into... a list :) But you can imagine to directly use the iterator returned by map instead: it iterates over each of your json lines. Note that in that case you need to do it in the with open(filepath, "r") as f context: that is the strength of this approach, the json lines are not fully loaded in a list, they are streamed: the map function read each line ... More on stackoverflow.com
🌐 stackoverflow.com
Python read JSON file and modify - Stack Overflow
Hi I am trying to take the data from a json file and insert and id then perform POST REST. my file data.json has: { 'name':'myname' } and I would like to add an id so that the json data looks ... 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
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
🌐
Real Python
realpython.com › python-json
Working With JSON Data in Python – Real Python
August 20, 2025 - Just like when writing files, it’s a good idea to use a context manager when reading a file in Python. That way, you don’t need to bother with closing the file again. When you want to read a JSON file, then you use json.load() inside the ...
🌐
Bobdc
bobdc.com › blog › pythonjson
Parsing JSON with Python
December 15, 2024 - My sample demo data to parse is pretty close to the test input that I used when I wrote about JSON2RDF: { "mydata": { "color": "red", "amount": 3, "arrayTest": [ "north", "south", "east", "escaped \"test\" string", "west" ], "boolTest": true, "nullTest": null, "addressBookEntry": { "givenName": "Richard", "familyName": "Mutt", "address": { "street": "1 Main St", "city": "Springfield", "zip": "10045" } } } } ... #!/usr/bin/env python3 import json f = open('jsondemo.js') data = json.load(f) print(data["mydata"]["color"]) print(data["mydata"]["amount"]) # Pull something out of the middle of an ar
🌐
Python
docs.python.org › 3 › library › json.html
json — JSON encoder and decoder
2 weeks ago - Deserialize fp to a Python object using the JSON-to-Python conversion table. ... fp (file-like object) – A .read()-supporting text file or binary file containing the JSON document to be deserialized.
Find elsewhere
🌐
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 - In our Python code, we will write a script to convert the JSON data into a Python dictionary: ''' devoriales.com, 2023 Path: json/get_data_from_files.py description: get data from files ''' import json # get data from a file in data folder with open('data/cars') as f: # open the file in read mode data = json.load(f) # type dict # print the data print(data)
🌐
Imperial College London
python.pages.doc.ic.ac.uk › java › lessons › java › 10-files › 03-load.html
Python for Java Programmers > Loading JSON files
To load your object directly from a JSON string rather than a file, use json.loads(string) (loads is short for ‘load string’). import json json_string = '[{"id": 2, "name": "Basilisk"}, {"id": 6, "name": "Nagaraja"}]' data = json.loads(json_string) print(data[0]) # {'id': 2, 'name': 'Basilisk'} print(data[1]["name"]) # Nagaraja
🌐
DataCamp
datacamp.com › tutorial › json-data-python
Python JSON Data: A Guide With Examples | DataCamp
December 3, 2024 - Configuration Files. JSON provides a simple and easy-to-read format for storing and retrieving configuration data. This can include settings for the application, such as the layout of a user interface or user preferences. IoT (Internet of Things). IoT devices often generate large amounts of data, which can be stored and transmitted between sensors and other devices more efficiently using JSON. python_obj = { "name": "John Doe", "age": 30, "email": "john.doe@example.com", "is_employee": True, "hobbies": [ "reading", "playing soccer", "traveling" ], "address": { "street": "123 Main Street", "city": "New York", "state": "NY", "zip": "10001" } } print(python_obj)
🌐
Codereview
codereview.doctor › features › python › best-practice › read-json-file-json-load
Use json.load to read a JSON file best practice | codereview.doctor
Python core developers are very careful about what features are included in the Python builtin modules, so it makes sense to utilise the convenience methods and not reinvent the wheel? For example, these result in the same outcome: with open('some/path.json', 'r') as f: content = json.load(f) with open('some/path.json', 'r') as f: content = json.loads(f.read()) So why not choose the easiest to read, write, and execute (the first one)?
🌐
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
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) The with statement is a python control-flow structure that simplifies the process of reading and closing the file.
🌐
W3Schools
w3schools.com › python › python_json.asp
Python JSON
JSON is text, written with JavaScript object notation. Python has a built-in package called json, which can be used to work with JSON data.
🌐
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?

🌐
TutorialsPoint
tutorialspoint.com › how-to-read-json-file-in-python
How to read JSON file in Python
load() ? This function is used to parse or read a json file. loads() ? This function is used to parse a json string. To use json module in python, we need to import it first.
🌐
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.
🌐
Reddit
reddit.com › r/python › handling json files with ease in python
r/Python on Reddit: Handling JSON files with ease in Python
May 29, 2022 -

I have finished writing the third article in the Data Engineering with Python series. This is about working with JSON data in Python. I have tried to cover every necessary use case. If you have any other suggestions, let me know.

Working with JSON in Python
Data Engineering with Python series

🌐
Zyte
zyte.com › home › blog › json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
July 6, 2023 - To read JSON data, you can use the built-in json module (JSON Encoder and Decoder) in Python. The json module provides two methods, loads and load, that allow you to parse JSON strings and JSON files, respectively, to convert JSON into Python ...
🌐
Scaler
scaler.com › home › topics › read, write, parse json file using python
Read, Write, Parse JSON File Using Python - Scaler Topics
April 17, 2024 - We write the dictionary to the file using the json.dump() method. The indent parameter is optional but recommended when you want the file to be human-readable, as it formats the JSON output with indented levels. ... Python's built-in json module provides a powerful yet simple interface for working with JSON data.