What JSON (JavaScript Object Notation) Meaning, Applications & Example

A lightweight data-interchange format.

What is JSON (JavaScript Object Notation)?

JSON (JavaScript Object Notation) is a lightweight, text-based data format used for representing structured data in a human-readable way. It is commonly used for transmitting data between a server and a web application or between different systems. JSON is language-independent, but it is most commonly associated with JavaScript, where it originated.

Syntax of JSON

JSON data is structured in key-value pairs and can represent objects, arrays, or primitive data types. The basic syntax includes:

  1. Objects: An unordered collection of key-value pairs enclosed in curly braces {}.
  2. Arrays: An ordered list of values enclosed in square brackets [].
  3. Key-Value Pairs: Each key (or property) is a string, followed by a colon : and the corresponding value, which can be a string, number, boolean, object, array, or null.
  4. Strings: Text data enclosed in double quotes "".
  5. Numbers: Numeric values can be integers or floating-point numbers.

Example of JSON Syntax

{
  "name": "John Doe",
  "age": 30,
  "isStudent": false,
  "address": {
    "street": "123 Main St",
    "city": "New York"
  },
  "phoneNumbers": ["123-456-7890", "987-654-3210"]
}

Key Characteristics of JSON

Applications of JSON

Example of JSON Usage

Here’s an example where JSON is used to send user information to a server in a web application:

{
  "username": "johndoe",
  "password": "password123",
  "email": "[email protected]",
  "preferences": {
    "theme": "dark",
    "language": "en"
  }
}

This JSON object represents the user’s credentials and preferences, and it could be sent via an HTTP request to a server for user authentication or data storage.

Read the Governor's Letter

Stay ahead with Governor's Letter, the newsletter delivering expert insights, AI updates, and curated knowledge directly to your inbox.

By subscribing to the Governor's Letter, you consent to receive emails from AI Guv.
We respect your privacy - read our Privacy Policy to learn how we protect your information.

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z