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
Error: Failed to decode JSON from the file. The Deserialization of JSON means the conversion of JSON objects into their respective Python objects. The load()/loads() method is used for it.
Published   September 15, 2025
Discussions

Processing large JSON files in Python without running out memory
for me, the real take away here is JSON-lines. how did I not know about this? More on reddit.com
🌐 r/Python
42
335
March 15, 2022
extracting data from 100+ pdf files
I actually just built a program to extract lab test data from PDFs for work and dump it into an ordered csv file. I won’t go into the nitty gritty details of everything I did, but it all started with the use of the pdfplumber package. It’s not too difficult to use. The GitHub will explain all of the necessary details. Using .extract_text() will give you all of the text as a single string with \n representing line breaks. From there it’s up to you to write the appropriate text parsing using regex and such. Note that pdfplumber won’t work in scanned PDFs. They have to have been computer generated. One nice thing about pdfplumber is using .extract_words() will generate a list of dictionaries for every word in the pdf. The dictionaries have location info which you can use to help crop the pdf based on the relative location of what you’re looking for to other nearby words. More on reddit.com
🌐 r/learnpython
92
264
October 4, 2020
People also ask

How to parse JSON strings in Python
To parse a JSON string in Python, we can use the built-in **`json`** module. This module provides two methods for working with JSON data: - **`json.loads()`** parses a JSON string and returns a Python object. - **`json.dumps()`** takes a Python object and returns a JSON string.
🌐
blog.apify.com
blog.apify.com › how-to-parse-json-with-python
How to parse JSON with Python
How to parse JSON with Python Pandas
To parse JSON with Python Pandas, we can use the pandas.read_json() function. This function can read JSON data into a pandas DataFrame, which allows for easy manipulation and analysis of the data.
🌐
blog.apify.com
blog.apify.com › how-to-parse-json-with-python
How to parse JSON with Python
How to Pretty Print JSON data in Python
When working with JSON data in Python, it can often be helpful to pretty print the data, which means to format it in a more human-readable way. The json module provides a method called json.dumps() that can be used to pretty print JSON data.
🌐
blog.apify.com
blog.apify.com › how-to-parse-json-with-python
How to parse JSON with Python
🌐
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
🌐
W3Schools
w3schools.com › PYTHON › python_json.asp
Python JSON
The result will be a Python dictionary. ... import json # some JSON: x = '{ "name":"John", "age":30, "city":"New York"}' # parse x: y = json.loads(x) # the result is a Python dictionary: print(y["age"]) Try it Yourself »
🌐
Python
docs.python.org › 3 › library › json.html
json — JSON encoder and decoder
2 weeks ago - JSONDecodeError – When the data being deserialized is not a valid JSON document. UnicodeDecodeError – When the data being deserialized does not contain UTF-8, UTF-16 or UTF-32 encoded data. ... Added the optional object_pairs_hook parameter. parse_constant doesn’t get called on ‘null’, ‘true’, ‘false’ anymore. ... All optional parameters are now keyword-only. fp can now be a binary file.
🌐
freeCodeCamp
freecodecamp.org › news › python-parse-json-how-to-read-a-json-file
Python Parse JSON – How to Read a JSON File
February 7, 2022 - Python has a built in module that allows you to work with JSON data. At the top of your file, you will need to import the json module. ... If you need to parse a JSON string that returns a dictionary, then you can use the json.loads() method.
Find elsewhere
🌐
Apify
blog.apify.com › how-to-parse-json-with-python
How to parse JSON with Python
March 11, 2025 - Learn to parse JSON strings with Python's built-in json module and convert JSON files using pandas.
🌐
Medium
medium.com › @datajournal › how-to-parse-json-data-with-python-99069a405e2b
How to Parse JSON Data With Python (EASY) | Medium
May 29, 2024 - Learn how to parse JSON data with Python, covering JSON syntax, Python libraries, and advanced parsing techniques for web scraping and data manipulation.
🌐
Reddit
reddit.com › r/python › processing large json files in python without running out memory
r/Python on Reddit: Processing large JSON files in Python without running out memory
March 15, 2022 - It's an array at the top level, you can keep track of braces and stream single top-level objects at a time. A streaming JSON parser just has to keep a tab of the tokens as it reads through the file until it reaches a limit or the end of a complete JSON object.
🌐
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 ...
🌐
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.
🌐
Scrapfly
scrapfly.io › blog › posts › how-to-use-python-to-parse-json
Ultimate Guide to JSON Parsing in Python
September 26, 2025 - This reads the JSON data from a file and converts it into a Python dictionary which are almost identical data structures commonly known as hashmaps, maps or associative arrays. To start here's an example of how to use Python to parse a json file:
🌐
GitHub
github.com › oxylabs › python-parse-json
GitHub - oxylabs/python-parse-json: A tutorial for parsing JSON data with Python · GitHub
The following table shows JSON objects and the Python data types after conversion. For more details, see Python docs. Save the following JSON data as a new file and name it united_states.json:
Author   oxylabs
🌐
FavTutor
favtutor.com › blogs › read-write-and-parse-json-in-python
Read, Write and Parse JSON File in Python
October 14, 2023 - In this example, we read the contents of the JSON file as a string using the read() method of the file object. We then pass this string to the json.loads() method, which parses the JSON data and converts it into a Python object.
🌐
Leapcell
leapcell.io › blog › how-to-read-json-in-python
How to Read JSON in Python | Leapcell
July 25, 2025 - To read a JSON file, use the json.load() method. This method reads from a file object and parses the JSON data:
🌐
Programiz
programiz.com › python-programming › json
Python JSON: Read, Write, Parse JSON (With Examples)
To work with JSON (string, or file containing JSON object), you can use Python's json module. You need to import the module before you can use it. ... The json module makes it easy to parse JSON strings and files containing JSON object.
🌐
ScrapingBee
scrapingbee.com › webscraping-questions › json › how-do-i-read-a-json-in-python
How do I read a JSON in Python? | ScrapingBee
To read a JSON file in Python, you can use the built-in json module. Here is a sample file.json file: { "name": "John Doe", "age": 32, "address": { "street": "123 Main St", "city": "Anytown", "state": "CA" }, } And here is some sample Python ...
🌐
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)
🌐
freeCodeCamp
freecodecamp.org › news › how-to-parse-json-in-python-with-examples
How to Parse JSON in Python – A Complete Guide With Examples
October 29, 2025 - Here’s a summary of what we covered: The core functions handle the most common operations: json.loads() parses JSON strings into Python objects, and json.load() reads and parses JSON from files.