Open In App

json.load() in Python

Last Updated : 11 Aug, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

JSON (JavaScript Object Notation) represents data as "key–value pairs", where:

  • Keys are always strings.
  • Values can be different JSON data types such as strings, numbers, booleans, arrays, or other JSON objects.

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.

Syntax

json.load(file_object)

  • Parameters: A file object opened in text mode ('r')
  • Return Type: A Python object (e.g., dict or list) that represents the JSON conten

Example

Let’s say we have a JSON file named data.json with the following structure:

pyhton-append-json1
json.load

We can read the file and access its content using json.load() as shown below:

Python
import json

# Opening and reading the JSON file
with open('data.json', 'r') as f:
    # Parsing the JSON file into a Python dictionary
    data = json.load(f)

# Iterating over employee details
for emp in data['emp_details']:
    print(emp)

Output:

python-read-json-output1

Article Tags :
Practice Tags :

Similar Reads