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
🌐
Readthedocs
precli.readthedocs.io › 0.7.6 › rules › python › stdlib › json-load
json — load - Precli Documentation
> precli --enable=all tests/unit/rules/python/stdlib/json/examples/json_loads.py ⚠️ Warning on line 4 in tests/unit/rules/python/stdlib/json/examples/json_loads.py PY009: Deserialization of Untrusted Data Potential unsafe usage of 'json.loads' that can allow instantiation of arbitrary objects.
🌐
Godot Forum
forum.godotengine.org › archive
How to store and load JSON data? - Archive - Godot Forum
March 3, 2021 - :information_source: Attention Topic was automatically imported from the old Question2Answer platform. :bust_in_silhouette: Asked By SteeveDroz I have a world map that is generated from a PNG file. A scri…
Discussions

python - Reading JSON from a file - Stack Overflow
If you have to parse the file, then .read would be a bad way of doing it, since you'll have to reimplement what the json module already does. 2021-03-20T01:20:38.82Z+00:00 ... I think LOAD will reimplement the JSON with python dictionary but READ helps to load the JSON directly to the data ... More on stackoverflow.com
🌐 stackoverflow.com
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 6, 2016
JSON load() vs loads()

load() loads JSON from a file or file-like object

loads() loads JSON from a given string or unicode object

It's in the documentation

More on reddit.com
🌐 r/learnpython
7
6
December 2, 2013
🌐
htmx
htmx.org › docs
htmx ~ Documentation
htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext htmx is small (~14k min.gz’d), dependency-free, extendable, IE11 compatible & has reduced ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › json-load-in-python
json.load() in Python - GeeksforGeeks
August 11, 2025 - json.load() function in Python is used to read a JSON file and convert it into a corresponding Python object, such as a dictionary or a list.
🌐
opencode
opencode.ai › docs › config
Config | OpenCode
5 days ago - Config sources are loaded in this order (later sources override earlier ones): Remote config (from .well-known/opencode) - organizational defaults · Global config (~/.config/opencode/opencode.json) - user preferences
🌐
LogRocket
blog.logrocket.com › home › reading and writing json files in node.js: a complete tutorial
Reading and writing JSON files in Node.js: A complete tutorial - LogRocket Blog
November 1, 2024 - More often than not, this JSON ... with files. In the Node runtime environment, you can use the built-in require function and fs modules to load or read JSON files....
Find elsewhere
🌐
Claude
code.claude.com › docs › en › cli-reference
CLI reference - Claude Code Docs
1 week ago - The --agents flag accepts a JSON object that defines one or more custom subagents.
🌐
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
🌐
Python
docs.python.org › 3 › library › json.html
json — JSON encoder and decoder
2 weeks ago - >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('"\\"foo\\bar"') '"foo\x08ar' >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io) ['streaming API']
🌐
Crumb
crumb.sh › xH7QUABJqji
Read JSON with json.loads - Python 3 code example - crumb.sh
Parsing a string of JSON data, also called decoding JSON, is as simple as using json.loads(…).
🌐
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.
🌐
Mapbox
geojson.io
geojson.io | powered by Mapbox
A quick, simple tool for creating, viewing, and sharing spatial data.
🌐
Playwright
playwright.dev › test generator
Test generator | Playwright
npx playwright codegen --load-storage=auth.json github.com/microsoft/playwright
🌐
JSON Viewer
jsonviewer.stack.hu
Online JSON Viewer and Formatter
Now you can import JSON files using the "Load JSON data" For any questions or problems please get in touch