Sunday, June 23, 2019

What is JSON

Every now and then, you must have heard the term, JSON. Let us learn JSON. The JSON full form is JavaScript Object Notation. It is a format for data exchange. Other data interchange formats are CSV and XML. There are several JSON data value types like String, Number, Object etc. View my 10-minute JSON tutorial or read more on JSON data examples...

JSON string - It is a sequence of characters delimited by double quotes e.g. "name" : "John"

JSON number - It is an integer or floating point number without double quotes e.g. "age" : 30

JSON object - It is an unordered set of name-value pairs. The JSON object starts with a left curly brace and ends with a right curly brace. Within the curly braces, the name-value pairs are separated by commas. Each name is a JSON string. The name is separated with a colon from its' value e.g.
 "from": {
    "address": "Brandy@example.com",
    "domain": "example.com",
    "safe sender": true
  }

JSON array - The JSON array starts with a left square bracket and ends with a right square bracket. Within the square brackets, there are JSON strings or JSON numbers, each separated by commas. e.g.
[“BMW”, “Ford”, “Toyota”]
[1,10,24,40,100]

JSON boolean - A JSON boolean value can be true or false e.g. “isCustomer”: true

JSON null - It is an empty data value e.g. “vehicle”: null

If you want to see sample JSON data, you can see it in the JSON official website.

Want to learn more like JSON file, JSON generator, JSON viewer and pretty JSON ? I have shown examples in the JSON Tutorial for Beginners. Thank you for reading.

1 comment: