Computerhelp4all logo Articles AboutTopicsQuizzesComputer Questions & AnswersComputer Terms & DefinitionsActivitiesContact

What Is JSON?

What Is JSON

Date First Published: 29th September 2022

Topic: Web Design & Development

Subtopic: Web Development

Article Type: Computer Terms & Definitions

Difficulty: Advanced

Difficulty Level: 8/10

Learn more about what JSON in this article.

Stands for JavaScript Object Notation. JSON is a lightweight data format used for storing and transmitting structured data and is pronounced like the name 'Jason'. The most common use is to transmit data between a page and a web server. Data is stored in name/value pairs and separated by commas. Curly braces ({) are used to hold objects and square brackets ([) are used to hold arrays. JSON allows for arrays, strings, objects, numbers, a boolean, and other data types.

JSON files can be identified by the file extension '.json' and can be edited with a text editor, such as Notepad. The JSON format was originally specified by Douglas Crockford in the early 2000s and he and Chip Morningstar sent the first JSON message in April 2001. An example of a JSON string that defines an object with three properties with a value can be seen below:

{ "name": "John", "surname": "Smith", "age": 35 }

JSON is an alternative to XML for storing and transmitting data between webpages and web servers. The JSON representation of an object uses much fewer lines of code than XML because it does not require opening and closing tags for each element. XML is also more difficult to parse than JSON as it is parsed with an XML parser rather than a ready-to-use JavaScript object, making it slower to read and write. JSON is parsed with a standard JavaScript function. Due to this fact, objects are represented more efficiently and it is often used in place of XML.

Is JSON The Same As JavaScript?

JSON is different from JavaScript. The syntax of JSON is based on JavaScript, but most JavaScript is not JSON. Unlike JavaScript, JSON requires double-quoted strings, has no support for comments, cannot be used to store binary data, and trailing commas are not allowed. Also, JSON is text-only and cannot be embedded into a HTML document using the <script> tag. Because the syntax of JSON is similar to JavaScript, it can be converted into native JavaScript objects using a JavaScript program.


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.