What is JSON?

JSON (JavaScript Object Notation) is an open standard messaging format used to exchange data between, and within, all types of web applications and servers. It is entirely text-based, making the format human-readable, and it is easily parsed by computers due to its straightforward, no-frills syntax. In API development, JSON is often favored over XML for its small learning curve, ease-of-use and comparatively low overhead.

JSON messages take the form of descriptive key-value pairs using common JavaScript object syntax. This enables quick integration of JSON data into existing JavaScript or Ajax-based applications. It is not restricted to JavaScript, however, and JSON can be used to easily exchange information across any programming language or framework.

Data types that can be expressed in JSON include: integers, strings, boolean, arrays, objects, and null. Objects in JSON syntax are denoted by simple hierarchical nesting.

The most general use case of JSON is retrieving data from a source to display inside an application. The source can be a typical HTTP web server, an external REST API, an IoT device, or any other web-based service. XMLHttpRequest and other Ajax-style methods are often used to perform the retrieval of JSON data in an asynchronous or realtime manner.

The official MIME type for JSON is application/json, while “.json” is the universally recognized file extension.

Related Terms

Try PubNub Today