JSON

JSON

A lightweight data-interchange format based on JavaScript object notation

Introduction

JSON (JavaScript Object Notation) is a text data format that is easy for humans to read and easy for machines to parse. It represents data as objects of key-value pairs and ordered arrays, and today it is the de facto standard interchange format for web APIs.

Built from just six types — string, number, boolean, null, object, and array — its rules are simple, and nearly every programming language supports it out of the box.

Syntax Features

Pros

  • Supported out of the box by almost every language and tool
  • Simple rules and fast parsing
  • The standard interchange format for web APIs

Cons

  • Cannot add comments
  • Cumbersome to hand-write in large amounts
  • Somewhat verbose as a configuration file

Common Uses

Example

[
  { "id": 1, "name": "Ada", "role": "admin" },
  { "id": 2, "name": "Linus", "role": "editor" }
]

Related Conversions