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
JSON (JavaScript Object Notation) is a format for storing and exchanging structured data. Python provides the built-in json module, which makes it easy to read JSON data from a file and convert it into Python objects such as dictionaries and lists.
Published: July 1, 2026
Discussions

Elegant Method in python to work with Json Files ?
Nothing could be easier. Import json filename = “stuff.json” # load from a file with open(filename) as jfile: data = json.load(jfile) Saving is like this, but open for writing and use json.dump. Lots of details here. https://realpython.com/python-json/ More on reddit.com
🌐 r/learnpython
27
5
October 11, 2025
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
24
0
June 26, 2024
Reading json data
People often seem to be confused about how to deal with nested data, but there's no need to be. The trick is to just think of each level in turn, and treat each one as a standalone data structure. So, response.json() will give you a dict, which includes a results key: response = requests.get('my url') data = response.json() results = data['results'] Now results is a list of dictionaries, which you can iterate through like any other list. And each item in that list is a dict, which you can access like any other dict: for item in results: print(item['consumption']) print(item['interval_start']) print(item['interval_end']) More on reddit.com
🌐 r/learnpython
3
9
October 17, 2023
Extracting data from JSON file
Can you show an example of the data? More on reddit.com
🌐 r/learnpython
11
2
March 30, 2024
🌐
Imperial College London
python.pages.doc.ic.ac.uk › java › lessons › java › 10-files › 03-load.html
Python for Java Programmers > Loading JSON files | Department of Computing | Imperial College London
[10.9] Reading CSV files into a dict · [10.10] Writing to CSV files · [10.11] That's a wrap! face Josiah Wang · 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).
🌐
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
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.
🌐
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.
Find elsewhere
🌐
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.
🌐
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 - Python's built-in json module makes it straightforward to parse JSON from files and strings, as well as serialize Python objects back to JSON. The simplest way to read a JSON file is with json.load():
🌐
YouTube
youtube.com › python tutorials for digital humanities
How to Read a JSON file in Python (Python and JSON Tutorial 02) - YouTube
If you enjoy this video, please subscribe. I provide all my content at no cost. If you want to support my channel, please donate viaPayPal: https://www.payp...
Published: April 7, 2020
Views: 10K
🌐
YouTube
youtube.com › watch
Working with Files in Python #8 - Working with JSON Files - YouTube
🧠🥷🏼 Get instant access to the full Python Masterclass:https://netninja.dev/p/python-masterclass➡️ Use promo code PYTHONMC to get the course half price (fi...
Published: August 30, 2024
🌐
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.
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.read_json.html
pandas.read_json — pandas 3.0.5 documentation
This method reads JSON files or JSON-like data and converts them into pandas objects. It supports a variety of input formats, including line-delimited JSON, compressed files, and various data representations (table, records, index-based, etc.).
🌐
Real Python
realpython.com › python-json
Working With JSON Data in Python – Real Python
August 20, 2025 - Learn how to work with JSON data in Python using the json module. Convert, read, write, and validate JSON files and handle JSON data for APIs and storage.
🌐
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)
🌐
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?

🌐
Leapcell
leapcell.io › blog › how-to-read-json-in-python
How to Read JSON in Python | Leapcell
July 25, 2025 - JSON is a lightweight data-interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It’s commonly used in web APIs and configuration files. ... Python’s json.loads() method can parse a JSON-formatted string and convert it into a Python dictionary:
🌐
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 - JSON files have a .json extension. You can convert JSON strings into Python objects and vice versa. You can read JSON files and create Python objects from their key-value pairs.
🌐
Zyte
zyte.com › home › blog › json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
December 3, 2024 - 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 ...
🌐
Medium
medium.com › @jimitdoshi639 › parse-content-in-json-file-into-a-dictionary-in-python-a-fun-and-informative-guide-88c169561550
Parse content in JSON file into a dictionary in Python: A fun and informative guide | by Jimit Doshi | Medium
May 4, 2024 - Parse JSON Data: Use the json.loads() function to parse the JSON data from the file into a Python dictionary. ... Here, parsed_data will be a dictionary containing the contents of the JSON file.