Here is the list of JSON data types.
Valid JSON Data Types
- String
- Number
- Object
- Array
- Boolean
- Null
1. JSON String Example:
{
"firstname": "D",
"lastname": "Cruise",
"occupation": "Actor"
}
2. JSON Number Example:
{
"id": 1,
"age": 56,
"bornyear": 1963,
"date": 3,
"month": 7,
"weight" : 67.5
}
3. JSON Object Example:
{
"actor": {
"name": "Tom Cruise",
"age": 56,
"Born At": "Syracuse, NY",
"Birthdate": "July 3 1962",
"photo": "https://jsonformatter.org/img/tom-cruise.jpg"
}
}
4. JSON Array Example
{
"Actors": [
{
"name": "Tom Cruise",
"age": 56,
"Born At": "Syracuse, NY",
"Birthdate": "July 3, 1962",
"photo": "https://jsonformatter.org/img/tom-cruise.jpg"
},
{
"name": "Robert Downey Jr.",
"age": 53,
"Born At": "New York City, NY",
"Birthdate": "April 4, 1965",
"photo": "https://jsonformatter.org/img/Robert-Downey-Jr.jpg"
}
]
}
5. JSON Boolean Example
{
"hasChildren":true,
"hasTwitterAccount":true,
"hasGreyHair":false
}
6. JSON Null Example
{
"wife":null
}
Example with all the JSON Data Type.
{
"Actors": [
{
"name": "Tom Cruise",
"age": 56,
"Born At": "Syracuse, NY",
"Birthdate": "July 3, 1962",
"photo": "https://jsonformatter.org/img/tom-cruise.jpg",
"wife": null,
"weight": 67.5,
"hasChildren": true,
"hasGreyHair": false,
"children": [
"Suri",
"Isabella Jane",
"Connor"
]
},
{
"name": "Robert Downey Jr.",
"age": 53,
"Born At": "New York City, NY",
"Birthdate": "April 4, 1965",
"photo": "https://jsonformatter.org/img/Robert-Downey-Jr.jpg",
"wife": "Susan Downey",
"weight": 77.1,
"hasChildren": true,
"hasGreyHair": false,
"children": [
"Indio Falconer",
"Avri Roel",
"Exton Elias"
]
}
]
}
Example 2 with all the JSON Data Type.
{
"id": 1,
"age": 30,
"Name": "James Bond",
"Address" :[
{
"city":"Los Angels",
"country": "USA"
},
{
"city":"London",
"country": "UK"
}
],
"wife":null,
"ishavingmobile":true,
"firstmovie" :{
"name":"Dr. No",
"releaseyear":1962
}
}