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
If we have used JSON data from another program or obtained it as a string format of JSON, then it can be deserialized with load()/loads(), which is usually used to load from string, otherwise, the root object is in list or dict.
Published   September 15, 2025
Discussions

Pulling data from local json file
I have not used json files as of yet, and I am curious on how to get the information out of it. I understand how to parse it which turns it into a javascript object, and then I can use that to populate what I need. However, all the examples I looked at they were creating a string in JavaScript ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
1
0
February 8, 2022
How do I write and load json files?

You can actually bypass the json.dumps and json.loads and just do this

import json

data = {'name':'chinpanze','age':24}
with open('data.json', 'w') as outfile:
json.dump(data, outfile)

with open('data.json') as json_file:
read = json.load(json_file)
print(read)
More on reddit.com
🌐 r/learnpython
5
2
June 7, 2016
Load json files and display in table
Heres info on how to work with input file https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications Essentially you want to create a Event listener, grab the input file into variable. And then you can display it's data and attach it to dom. If you don't know how to grab a element, listen to events or assign variables and objects in JavaScript then you need to do a simple tutorial first. More on reddit.com
🌐 r/vuejs
8
5
August 26, 2019
Best way to load static json data?
I'd import it where I needed it and not overthink it. Webpack for the most part will do the right thing. More on reddit.com
🌐 r/reactjs
1
1
January 28, 2019
🌐
Python
docs.python.org › 3 › library › json.html
json — JSON encoder and decoder
2 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)¶
🌐
JSON Formatter
jsonformatter.org › json-viewer
JSON Viewer Online Best and Free
Upload JSON file, Upload url of JSON and view in Tree Structure Viewer.
Find elsewhere
🌐
DataCamp
datacamp.com › tutorial › json-data-python
Python JSON Data: A Guide With Examples | DataCamp
December 3, 2024 - This function is used to read a JSON file and parse its contents into a Python object. The load() function takes a single argument, the file object, and returns a Python 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.
🌐
npm
npmjs.com › package › load-json-file
load-json-file - npm
import {loadJsonFile} from 'load-json-file'; console.log(await loadJsonFile('foo.json')); //=> {foo: true}
      » npm install load-json-file
    
Published   Sep 13, 2021
Version   7.0.1
Author   Sindre Sorhus
🌐
W3Schools
w3schools.com › python › python_json.asp
Python JSON
If you have a JSON string, you can parse it by using the json.loads() method.
🌐
Qlik Community
community.qlik.com › t5 › Member-Articles › How-to-read-json-files-with-Qlik-Sense › ta-p › 2120598
How to read .json files with Qlik Sense - Qlik Community - 2120598
May 12, 2025 - Pointless, but at least you get the FROM construct properly filled. Forget the rest, as we will replace it in a minute. Just hit "Insert script" and then put LOAD * in front of FROM, and instead of (txt ...) put (json):
🌐
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 - Instead of using the read method of the file object and using the loads method of the json module, you can directly use the load method which reads and parses the file object.
🌐
JSON Editor Online
jsoneditoronline.org
JSON Editor Online: edit JSON, format JSON, query JSON
Copy and paste your JSON file in the JSON editor, or load it from disk via the menu or via drag-and-drop. Then, you can edit the contents similar to how you use any text editor: enter new content with your keyboard, and right-click to open a ...
🌐
Plain English
python.plainenglish.io › how-to-read-json-files-in-python-aec189287cfe
How to Read JSON Files in Python. This article will cover how to read… | by Crawlbase | Python in Plain English
May 18, 2025 - This article will cover how to read JSON files in Python, load and parse JSON data, and work with its structures. You’ll also learn how to…
🌐
HackerNoon
hackernoon.com › how-to-read-and-write-json-files-in-python
How to read and write JSON files in Python | HackerNoon
March 19, 2024 - We will discuss how to use Python to read, write, and manipulate JSON files.
🌐
GitHub
github.com › nlohmann › json
GitHub - nlohmann/json: JSON for Modern C++ · GitHub
In languages such as Python, JSON feels like a first-class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. Check out the examples below and you'll know what I mean. Trivial integration. Our whole code consists of a single header file json.hpp.
Starred by 49.1K users
Forked by 7.3K users
Languages   C++ 96.9% | CMake 2.0% | Python 0.6% | Makefile 0.3% | Starlark 0.1% | Jinja 0.1%
🌐
GeeksforGeeks
geeksforgeeks.org › python › reading-and-writing-json-to-a-file-in-python
Reading and Writing JSON to a File in Python - GeeksforGeeks
Reading JSON in Python means retrieving ... offers two main ways to read JSON data: The JSON package has json.load() function that loads the JSON content ......
Published   August 5, 2025