What is a JSON file?
What is a JSON file?
JSON (JavaScript Object Notation) is an open standard file format for sharing data that uses human-readable text to store and transmit data. JSON files are stored with the .json extension. JSON requires less formatting and is a good alternative to XML. JSON is native to JavaScript but is a language-independent data format. JSON generation and parsing is supported by many modern programming languages. application/json is the media type used for JSON.
Brief history of the JSON file format
The need to communicate between server and client in real time led to the creation of JSON. The JSON format was first specified by Douglas Crockford in March 2001. JSON is based on the ECMA-262 standard 3rd Edition - December 1999, which is a subset of JavaScript.
The first version of the JSON ECMA-404 standard was published in October 2013 by Ecma International. RFC 7159 became the primary reference for the Internet use of JSON in 2014. In November 2017, ISO/IEC 21778:2017 was published as an international standard. RFC 8259 was published by The Internet Engineering Task Force on December 13, 2017, which is the current version of the Internet standard STD 90.
JSON file structure
JSON data is written in key/value pairs. The key and value are separated by a colon (:) in the middle with the key on the left and the value on the right. Different key/value pairs are separated by a comma (,). Key is a string surrounded by quotes, e.g. 'name'. Values can be of the following types.
- Numbers
- String: String of Unicode characters surrounded by quotes.
- Boolean: True or False.
- Array: Example of a list of values surrounded by square brackets
[ "Apple", "Banana", "Orange" ]
- Object: For example, a collection of key/value pairs surrounded by curly braces
{"name": "Jack", "age": 30, "favoriteSport" : "Football"}
JSON objects can also be nested to represent the structure of the data. Below is an example of a JSON object.
JSON format example
{ "name":"Jack", "age":30, "contactNumbers":[ { "type":"Home", "number":"123 123-123" }, { "type":"Office", "number":"321 321-321" } ], "spouse":null, "favoriteSports":[ "Football", "Cricket" ] }
What is the maximum size of a JSON file?
There is actually no limit to the maximum size of a JSON file. It can be as long as the space required by the content being stored.
When it comes to using the JSON file format to transmit data over the Internet, one needs to be careful about the available resources of the computer. If large JSON data is transferred, the transfer will be affected if the client browser has limited memory.
There is no fixed limit defined by the specification, but you need to be careful not to exhaust the resources on the user's computer, as it will quickly degrade the user experience and they may will abandon your application.
What makes JSON superior to XML?
XML is another popular and widely used file format for exchanging data over the Internet. When it comes to exchanging data between applications, developers have the option of using both XML and JSON file formats. However, JSON is considered the most convenient way to exchange data between applications over the Internet for the following reasons.
- JSON provides a clearer and easier to read view of data than XML file formats
- JSON reduces the cost of transmitting data over the Internet because it has fewer characters to identify the same set of data compared to XML
- Modern programming languages provide built-in parsers to parse JSON responses on the web.
You should read it
May be interested
- What are malicious apps? How dangerous are they?with thousands of great apps out there, cybercriminals have also developed their own dangerous versions of common phone programs, called malicious apps.
- What is Zigbee wave? Does it affect health?should you choose a smart home with zigbee wave technology? is a question that many people wonder? the article below will answer you what is zigbee wave? does it affect health?
- Which country is the 001 number from? List of countries in the worldyou receive calls from numbers 001, +1, but don't know where, is it a virtual phone number or not? so which country does the 001 number belong to? please refer to the list of countries around the world in this article!
- Popular video formats todayany video cannot be suitable for all devices, so videos are classified into many different formats. below are popular video formats today.
- What is Windows PowerShell? How to use Windows PowerShelldo you want to learn the features of windows powershell but don't know how? suggestions for you what is windows powershell? the most convenient way to use windows powershell.
- What is Microsoft Power Automate? how does it use?microsoft knows that many common tasks can easily be automated, and that's where power automate comes into play. this app comes pre-installed with windows 11, but it sucks if you don't even know it's there.