Skip to content

// glossary

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that uses human-readable key-value pairs and arrays to structure data.

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that uses human-readable key-value pairs and arrays to structure data. Despite the name, JSON is language-independent and supported by virtually every programming language in use today.

Structure and syntax

JSON is built on two structures: objects (unordered sets of key-value pairs wrapped in curly braces) and arrays (ordered lists wrapped in square brackets). Values can be strings, numbers, booleans, null, objects, or arrays. Keys are always double-quoted strings.

{
  "name": "Ada Lovelace",
  "age": 36,
  "languages": ["Python", "Rust"],
  "active": true
}

There are no comments in JSON. Trailing commas are invalid. These two rules trip up almost everyone at some point.

Why developers use JSON

JSON became the default format for web APIs because it maps naturally to the data structures most languages already have — dictionaries, maps, hash tables, structs. It’s less verbose than XML, easier to read than binary formats, and trivial to parse with built-in functions like JSON.parse() in JavaScript or json.loads() in Python.

REST APIs almost universally return JSON. Configuration files (like package.json, tsconfig.json, .eslintrc.json) use it heavily. NoSQL databases like MongoDB store data as JSON-like documents (BSON).

Common operations

Working with JSON day-to-day means formatting, validating, converting, and diffing. Minified JSON from an API response is unreadable without a formatter. A missing comma or extra trailing bracket breaks parsing entirely, so validation matters.

You can format and inspect JSON with the JSON Formatter, check syntax with the JSON Validator, or strip whitespace with the JSON Minifier. Need to convert formats? Try JSON to YAML or JSON to CSV. The JSON Tree Viewer is useful for navigating deeply nested structures.

Limitations

JSON has no native date type — dates are typically strings in ISO 8601 format. It doesn’t support comments, binary data, or circular references. For configuration files where comments are needed, consider YAML or JSON5. For binary-heavy payloads, Protocol Buffers or MessagePack are better fits.

#Related Tools

#Related Terms

#Learn More