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
311

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
April 23, 2019
JSON load() vs loads() : r/learnpython
Subreddit for posting questions and asking for general advice about your python code. ... Can someone explain what the difference is between using either load() or loads() is with the JSON library? More on reddit.com
🌐 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
August 4, 2023
Is there a Python equivivalent of JavaScript's JSON.stringify() ?

I don't really understand what you're asking. You don't want 'false' as a string, that's not how it's done in JSON. The inverse of json.loads() is json.dumps() and it handles all the necessary mapping between Python types and JS types.

>>> import json
>>> foo = {1: True}
>>> json.dumps(foo)
'{"1": true}'
More on reddit.com
🌐 r/learnpython
5
2
January 12, 2017
🌐
Reddit
reddit.com › r/learnpython › json load() vs loads()
r/learnpython on Reddit: JSON load() vs loads()
October 8, 2015 -

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

🌐
Just Academy
justacademy.co › blog-detail › json-load-vs-loads
JSON LOAD VS loads by Roshan Chaturvedi | JustAcademy
May 7, 2024 - JSON LOAD VS loadsThe `json.load()` method in Python is used to load a JSON file as a Python object, while `json.loads()` is used to load a JSON-formatted string into a Python object.
🌐
Medium
medium.com › @gadallah.hatem › the-difference-between-json-loads-and-json-load-2dbd30065f26
The difference between json.loads() and json. ...
December 15, 2024 - The difference between json.loads() and json.load() lies in what they expect as input and where they are commonly used ... Purpose: Converts a JSON-encoded string into a Python object (e.g., dictionary or list).
🌐
Medium
medium.com › snowflake › json-methods-load-vs-loads-and-dump-vs-dumps-21434a520b17
JSON Methods: load vs loads() and dump vs dumps() | by Sachin Mittal | Snowflake Builders Blog: Data Engineers, App Developers, AI, & Data Science | Medium
May 2, 2022 - Json.loads(): to convert JSON string to a dictionary. Sometimes we receive JSON response in string format. So to use it in our application, we need to convert JSON string into a Python dictionary.
🌐
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.
Find elsewhere
🌐
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 - Python built-in module json provides the following two methods to decode JSON data. ... To parse JSON from URL or file, use json.load().
🌐
Just Academy
justacademy.co › blog-detail › json-load-vs-json-loads
JSON Load vs JSON Loads
The `json.load()` method in Python is used to read and parse JSON data from a file, while `json.loads()` method is used to parse JSON data that is stored as a string. Both methods are helpful for converting JSON data into Python objects, making ...
🌐
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) with the following contents [code][ {"name"...
🌐
GeeksforGeeks
geeksforgeeks.org › python › orjson-loads-vs-json-loads-in-python
json.loads() vs json.loads() in Python - GeeksforGeeks
July 23, 2025 - It is a C extension that is up to 20 times faster than the built-in json module in Python. This speed is achieved by using highly optimized C code. Functionality: orjson is designed to be a drop-in replacement for the json module. It supports all the same functionality as json, but with better performance. However, there are some differences in behavior between orjson and json. For example, orjson does not support the object_hook and object_pairs_hook arguments that json supports. Here's a table comparing orjson.loads() and json.loads() in Python based on various factors:
🌐
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 - On the other hand, we have json.loads, which stands for “load string.” This method takes a string formatted as JSON rather than reading from an external source like a file. It’s particularly useful when you receive JSON data as part of ...
🌐
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.
🌐
Plain English
python.plainenglish.io › json-dumps-vs-json-dump-vs-json-loads-vs-json-load-in-python-99040c885c90
json.dumps VS json.dump VS json.loads VS json. ...
August 10, 2023 - json.loads · Takes in a JSON string (str type) converts it into a Python object (list/dict) returns a Python object (list/dict) 99K followers · ·Last published 4 hours ago · New Python content every day. Follow to join our 3.5M+ monthly readers. 100K followers ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › json-loads-in-python
json.loads() in Python - GeeksforGeeks
Explanation: json.loads(s) parses the JSON string s and converts it into a Python dict.
Published: January 13, 2026
🌐
RunxBuild
runxbuild.com › home › blog › json.loads in python: loads vs load, and the errors you will actually hit
json.loads in Python: loads vs load, and the Errors You Will Actually Hit
July 21, 2026 - json.loads(s) takes a JSON string ... that is the entire difference between loads and load: load reads from a file object, loads reads from a string already in memory....
🌐
sqlpey
sqlpey.com › python › python-json-loading-file-handling
Python JSON Loading: load vs loads & File Handling - sqlpey
July 25, 2025 - json.loads() is used when you have a JSON string already present in a Python variable.
🌐
OpenPython
openpython.org › articles › python-json-loads-vs-json-load
Python json.loads() vs json.load(): What's the Difference? | OpenPython
July 22, 2026 - Understand the difference between Python json.loads() and json.load(). Learn when to use each, the common mistake of passing a filename to json.load(), how requests.response.json() fits in, and encoding considerations.
🌐
Analytics Vidhya
analyticsvidhya.com › home › python json.loads() and json.dump() methods
Python json.loads() and json.dump() methods - Analytics Vidhya
May 1, 2025 - To choose the right function for the task, we need to consider whether we want to convert JSON data into Python objects or Python objects into JSON data. If we have a JSON string and want to work with it in Python, we should use json.loads().
🌐
PyTutorial
pytutorial.com › python-json-loads-from-file
PyTutorial | Python Json Loads From File
May 28, 2026 - json.load() reads JSON from a file object. json.loads() reads JSON from a string. The "s" in loads stands for string. Use json.load() when you have a file. Use json.loads() when you have a string.