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
๐ŸŒ
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.
๐ŸŒ
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
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
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 - JSON (JavaScript Object Notation) is a lightweight, human-readable format that maps naturally to Python dictionaries and lists. Python's built-in json module makes it straightforward to parse JSON from files and strings, as well as serialize ...
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ reading-and-writing-json-to-a-file-in-python
Reading and Writing JSON to a File in Python - GeeksforGeeks
Explanation: We define a JSON string ... Writing data to a JSON file in Python involves converting Python objects like dictionaries into JSON format and saving them to a file....
Published: August 5, 2025
๐ŸŒ
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 - Each JSON object holds the data of a pizza order. If we want to read this file in Python, we just need to use a with statement:
๐ŸŒ
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
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-json
Python JSON - GeeksforGeeks
December 23, 2025 - In this section, we will cover the basics of JSON, its data types, and how to work with, read, write, and parse JSON data in Python. ... You can read, write, and append JSON data to files in Python using the json module.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ using โ€บ windows.html
4. Using Python on Windows โ€” Python 3.14.7 documentation
A global configuration file may be configured by an administrator, and would be read first. The user configuration file is stored at %AppData%\Python\pymanager.json (note that this location is under Roaming, not Local) and is read next, overwriting any settings from earlier files.
๐ŸŒ
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

๐ŸŒ
Medium
medium.com โ€บ @ryan_forrester_ โ€บ writing-json-to-a-file-in-python-a-step-by-step-guide-630584957d07
Writing JSON to a File in Python: A Step-by-Step Guide | by ryan | Medium
November 6, 2024 - Writing JSON to a file in Python is a simple and effective way to store data. By using the `json` module, you can easily convert Python dictionaries to JSON format and save them for later use.
๐ŸŒ
Astral
docs.astral.sh โ€บ uv โ€บ guides โ€บ scripts
Running scripts | uv
December 9, 2025 - A guide to using uv to run Python scripts, including support for inline dependency metadata, reproducible scripts, and more.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ whatsnew โ€บ 3.14.html
Whatโ€™s new in Python 3.14
RFC 9512 application/yaml MIME type for YAML files (.yaml and .yml) Add 7z application/x-7z-compressed (.7z) Add Android Package application/vnd.android.package-archive (.apk) when not strict ยท Add deb application/x-debian-package (.deb) Add glTF binary model/gltf-binary (.glb) Add glTF JSON/ASCII model/gltf+json (.gltf) Add M4V video/x-m4v (.m4v) Add PHP application/x-httpd-php (.php) Add RAR application/vnd.rar (.rar) Add RPM application/x-rpm (.rpm) Add STL model/stl (.stl) Add Windows Media Video video/x-ms-wmv (.wmv) De facto: Add WebM audio/webm (.weba) ECMA-376: Add .docx, .pptx and .xlsx types ยท
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ tutorial โ€บ inputoutput.html
7. Input and Output โ€” Python 3.14.7 documentation
Rather than having users constantly writing and debugging code to save complicated data types to files, Python allows you to use the popular data interchange format called JSON (JavaScript Object Notation).
๐ŸŒ
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 ...
๐ŸŒ
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 - JSON (JavaScript Object Notation) is a popular way to structure data. It's used to exchange information between a web application and the server. But how do you read a JSON file in Python? In this article, I will show you how to use the json.loads() ...