Yes, s stands for string. The json.loads function does not take the file path, but the file contents as a string. Look at the documentation.

Simple example:

with open("file.json") as f:
  data = json.load(f)  # ok

  data = json.loads(f)  # not ok, f is not a string but a file
text = '{"a": 1, "b": 2}'  # a string with json encoded data
data = json.loads(text) 
Answer from Gijs on Stack Overflow
Top answer
1 of 6
306

Yes, s stands for string. The json.loads function does not take the file path, but the file contents as a string. Look at the documentation.

Simple example:

with open("file.json") as f:
  data = json.load(f)  # ok

  data = json.loads(f)  # not ok, f is not a string but a file
text = '{"a": 1, "b": 2}'  # a string with json encoded data
data = json.loads(text) 
2 of 6
138

Just going to add a simple example to what everyone has explained,

json.load()

json.load can deserialize a file itself i.e. it accepts a file object, for example,

# open a json file for reading and print content using json.load
with open("/xyz/json_data.json", "r") as content:
  print(json.load(content))

will output,

{u'event': {u'id': u'5206c7e2-da67-42da-9341-6ea403c632c7', u'name': u'Sufiyan Ghori'}}

If I use json.loads to open a file instead,

# you cannot use json.loads on file object
with open("json_data.json", "r") as content:
  print(json.loads(content))

I would get this error:

TypeError: expected string or buffer

json.loads()

json.loads() deserialize string.

So in order to use json.loads I will have to pass the content of the file using read() function, for example,

using content.read() with json.loads() return content of the file,

with open("json_data.json", "r") as content:
  print(json.loads(content.read()))

Output,

{u'event': {u'id': u'5206c7e2-da67-42da-9341-6ea403c632c7', u'name': u'Sufiyan Ghori'}}

That's because type of content.read() is string, i.e. <type 'str'>

If I use json.load() with content.read(), I will get error,

with open("json_data.json", "r") as content:
  print(json.load(content.read()))

Gives,

AttributeError: 'str' object has no attribute 'read'

So, now you know json.load deserialze file and json.loads deserialize a string.

Another example,

sys.stdin return file object, so if i do print(json.load(sys.stdin)), I will get actual json data,

cat json_data.json | ./test.py

{u'event': {u'id': u'5206c7e2-da67-42da-9341-6ea403c632c7', u'name': u'Sufiyan Ghori'}}

If I want to use json.loads(), I would do print(json.loads(sys.stdin.read())) instead.

🌐
GeeksforGeeks
geeksforgeeks.org › python › python-difference-between-json-load-and-json-loads
Difference Between json.load() and json.loads() - Python - GeeksforGeeks
July 3, 2025 - json.load() takes a file object and returns the json object. It is used to read JSON encoded data from a file and convert it into a Python dictionary and deserialize a file itself i.e.
Discussions

Json + python == confusion.
We really need to see what code you have produced so far to attempt this. If you could post that as well it would be helpful. Without that there isn't much specific advice I can give. You need to be able to handle two things in order to achieve this; Python file operations (opening a file, writing to a file, reading from a file etc) JSON parsing (converting the JSON string into a useful data structure in your program) You can find more on file operations here; https://www.w3schools.com/python/python_file_handling.asp and you can use import json to get access to the JSON parsing library described here; https://www.w3schools.com/python/python_json.asp If you want more help, you will need to provide us with your code and state what specific problems you are having or errors you are getting. More on reddit.com
🌐 r/learnprogramming
10
8
February 26, 2019
JSON load() vs loads() : r/learnpython
🌐 r/learnpython
Efficiently Load Large JSON Files Object by Object
What structures did you test with? I imagine this would be very useful for a JSON that's a long list of items... Does this also help for a file that is one big object? (I assume not?) How about nested lists? More on reddit.com
🌐 r/Python
2
0
June 30, 2023
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
November 28, 2013
🌐
Reddit
reddit.com › r/learnpython › json load() vs loads()
r/learnpython on Reddit: JSON load() vs loads()
November 28, 2013 -

Can someone explain what the difference is between using either load() or loads() is with the JSON library? And which, if either, is the preferred method.

I'm writing a simple script where I want the JSON data from a URL parsed out into a list. Both of these options seem to work:

import json
import urllib2

url = "string to url"

response = urllib2.urlopen(url)
data = json.load(response)

or

import json
import urllib2

url = "string to url"

response = urllib2.urlopen(url)
data = json.loads(response.read())

I know that there are other libraries available for parsing out JSON data, but for the time being I'm working only with the json and urllib2 libraries.

Any insight into which one should be used?

Thanks

🌐
Medium
medium.com › @gadallah.hatem › the-difference-between-json-loads-and-json-load-2dbd30065f26
The difference between json.loads() and json.load() in Python | by Hatem A. Gad | Medium
December 15, 2024 - Feature json.loads() json.load() Input JSON string (in memory). File object or stream (on disk or in memory). Output Python object (dict, list, etc.). Python object (dict, list, etc.). Use Case Parsing JSON strings (e.g., API responses). Parsing JSON files or streams.
🌐
Just Academy
justacademy.co › blog-detail › json-load-vs-loads
JSON LOAD VS loads
May 7, 2024 - It is used when you have a JSON string as input and you want to convert it into a dictionary or list of dictionaries. The ‘s’ in loads stands for ‘string’, as it takes a JSON string as input.
🌐
GeeksforGeeks
geeksforgeeks.org › python › orjson-loads-vs-json-loads-in-python
json.loads() vs json.loads() in Python - GeeksforGeeks
July 23, 2025 - In this example, below Python code compares the performance of the standard json library and the optimized orjson library for encoding and decoding JSON data. It first loads JSON data from a file, measures the time taken to decode the data using json.loads(), and then does the same using orjson.loads().
Find elsewhere
🌐
Quora
quora.com › What-is-the-usage-of-Json-load-and-JSON-loads-in-Python
What is the usage of Json.load and JSON.loads in Python? - Quora
Answer (1 of 2): The difference is in the source of the JSON text * [code ]json.load()[/code] expects to get the text from a file-like object * [code ]json.loads()[/code] expects to get its text from a string object Assume you have a file (json.txt) ...
🌐
GeeksforGeeks
geeksforgeeks.org › python-difference-between-json-load-and-json-loads
Python - Difference Between json.load() and json.loads() - GeeksforGeeks
November 26, 2020 - json.load() takes a file object and returns the json object. It is used to read JSON encoded data from a file and convert it into a Python dictionary and deserialize a file itself i.e.
🌐
Python
docs.python.org › 3 › library › json.html
JSON encoder and decoder — Python 3.14.3 documentation
3 weeks ago - When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is converted into JSON and then back into a dictionary, the dictionary may not equal the original one. That is, loads(dumps(x)) != x if x has non-string keys.
🌐
Educative
educative.io › answers › what-is-the-difference-between-jsonloads-and-jsondumps
What is the difference between json.loads() and json.dumps()?
In summary, json.loads() converts JSON strings to Python objects, while json.dumps() converts Python objects to JSON strings.
🌐
PYnative
pynative.com › home › python › json › python json parsing using json.load() and loads()
Python JSON Parsing using json.load() and loads()
May 14, 2021 - When you execute a json.load or json.loads() method, it returns a Python dictionary. If you want to convert JSON into a custom Python object then we can write a custom JSON decoder and pass it to the json.loads() method so we can get a custom Class object instead of a dictionary. Let’s see how to use the JSON decoder in the load method.
🌐
Codecademy
codecademy.com › docs › python › json module › .load()
Python | JSON Module | .load() | Codecademy
May 29, 2025 - The .load() method in Python’s JSON module is used to parse JSON data from a file-like object and convert it into a Python object. This method reads JSON content directly from files, such as .json files, and transforms the structured data into native Python data types like dictionaries, lists, strings, numbers, and booleans.
🌐
Srinimf
srinimf.com › 2023 › 01 › 23 › python-json-dump-vs-load-whats-the-difference
Python JSON Dump Vs. Load: What’s the Difference
November 1, 2023 - The JSON.load requires that the entire file is in standard JSON format, so if your file contains other information, you should load the JSON string first and parse it with loads rather than using load directly.
🌐
Oreate AI
oreateai.com › blog › understanding-jsonload-vs-jsonloads-in-python › 90ebefc58481fbca189962dece43d86a
Understanding json.load vs. json.loads in Python - Oreate AI Blog
January 15, 2026 - Both methods serve crucial roles ... to choose wisely based on your specific needs; if you're handling static files use load, but if you're parsing dynamic strings go for loads....
🌐
Analytics Vidhya
analyticsvidhya.com › home › python json.loads() and json.dump() methods
Python json.loads() and json.dump() methods - Analytics Vidhya
May 1, 2025 - The json.loads() function automatically converts JSON data types to their corresponding Python data types. For example, JSON strings are converted to Python strings, JSON numbers are converted to Python integers or floats, and JSON arrays are converted to Python lists.
🌐
Codereview
codereview.doctor › features › python › best-practice › read-json-file-json-load
Use json.load to read a JSON file best practice | codereview.doctor
json.loads is for deserialising a string containing JSON, while json.load (no "s") is for deserialising a file containing JSON.
🌐
Bogotobogo
bogotobogo.com › python › python-json-dumps-loads-file-read-write.php
Python Tutorial: json.dump(s) & json.load(s) - 2024
# Four Fundamental Forces with JSON d = {} d ["gravity"] = { "mediator":"gravitons", "relative strength" : "1", "range" : "infinity" } d ["weak"] = { "mediator":"W/Z bosons", "relative strength" : "10^25", "range" : "10^-18" } d ["electromagnetic"] = { "mediator":"photons", "relative strength" : "10^36", "range" : "infinity" } d ["strong"] = { "mediator":"gluons", "relative strength" : "10^38", "range" : "10^-15" } import json # encoding to JSON data = json.dumps(d) # write to a file with open("4forces.json","w") as f: f.write(data) # reads it back with open("4forces.json","r") as f: data = f.read() # decoding the JSON to dictionay d = json.loads(data) print(d)
🌐
Just Academy
justacademy.co › blog-detail › json-load-vs-json-loads
JSON Load vs JSON Loads
1 - `json.load` is a method in Python used to load JSON data from a file, while `json.loads` is a method used to load JSON data from a string.