0% found this document useful (0 votes)
2 views2 pages

JSON Data Types

JSON (JavaScript Object Notation) is a widely used, lightweight, language-independent data format for web data interchange. It supports six data types: String, Number, Boolean, Null, Object, and Array, with the first four being simple types and the latter two being complex types. JSON structures include strings in double quotes, numbers in base 10, and objects as sets of key-value pairs within curly braces.

Uploaded by

jyoshcherrygoud
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

JSON Data Types

JSON (JavaScript Object Notation) is a widely used, lightweight, language-independent data format for web data interchange. It supports six data types: String, Number, Boolean, Null, Object, and Array, with the first four being simple types and the latter two being complex types. JSON structures include strings in double quotes, numbers in base 10, and objects as sets of key-value pairs within curly braces.

Uploaded by

jyoshcherrygoud
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JSON Data Types

Last Updated : 11 Jul, 2025


JSON (JavaScript Object Notation) is the most widely used data format for
data interchange on the web. JSON is a lightweight text-based, data-
interchange format and it is completely language-independent.

JSON Data Types

JSON supports mainly 6 data types:


1. String
2. Number
3. Boolean
4. Null
5. Object
6. Array
Note: string, number, boolean, null are simple data types or primitives
data types whereas object and array are referred as complex data types.

JSON String
JSON strings must be written in double quotes like C-language there are
various special characters(Escape Characters) in JSON that you can use
in strings such as \ (backslash), / (forward slash), b (backspace), n (new
line), r (carriage return), t (horizontal tab), etc.
{ "name":"Vivek" }
{ "city":"Delhi\/India" }

here \/ is used for Escape Character / (forward slash).

JSON Number
Represented in base 10 and octal and hexadecimal formats are not used.
{ "age": 20 }
{ "percentage": 82.44}

JSON Boolean
This data type can be either true or false.
{ "result" : true }

JSON Null
It is just a define nullable value.
{
"result" : true,
"grade" : null,
"rollno" : 210
}

JSON Object
It is a set of name or value pairs inserted between {} (curly braces). The
keys must be strings and should be unique and multiple key and value
pairs are separated by a, (comma).
{
"Geek":{ "name":"Peter", "age":20, "score": 50.05}
}

JSON Array
It is an ordered collection of values and begins with [ (left bracket) and
ends with ] (right bracket). The values of array are separated by
, (comma).
{
"geek":[ "Sahil", "Vivek", "Rahul" ]
}

{
"collection" : [
{"id" : 101},
{"id" : 102},
{"id" : 103}
]
}

You might also like