Learn/JSON Fundamentals

Introduction to JSON

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. It is the most widely used format for transmitting data between servers and web applications, storing configuration, and structuring APIs.

Beginner~8 min read

What is JSON?

JSON is a text-based format that uses human-readable conventions borrowed from JavaScript’s object literal syntax. Despite its JavaScript roots, JSON is completely language-independent and supported natively by every major programming language.

A JSON document is always one of two structures: an object (a collection of key-value pairs wrapped in curly braces) or an array (an ordered list wrapped in square brackets).

A simple JSON objectjson
1{
2 "name": "Regimify",
3 "type": "developer-tools",
4 "version": "2.0.1",
5 "isActive": true,
6 "features": ["JSON tools", "learning platform", "converters"]
7}

Why JSON Matters

JSON dominates modern development because of five key properties:

Readable

Humans can read and write JSON without special tools.

Lightweight

Minimal syntax overhead compared to XML or YAML.

Universal

Native support in JavaScript, Python, Go, Java, Ruby, PHP, and more.

Fast

Parsers are highly optimized — typically 2-10x faster than XML parsing.

JSON Structure at a Glance

JSON Document Structure

A Brief History

01

2001 — Douglas Crockford introduces JSON

Based on a subset of JavaScript object literals, designed for simplicity.

02

2006 — RFC 4627 published

First formal specification of JSON as an internet standard.

03

2013 — ECMA-404 standard

JSON receives an international standard (ECMA International).

04

2017 — RFC 8259 (current spec)

Supersedes RFC 4627 with stricter encoding rules (must be UTF-8).

JSON vs XML vs YAML

Developers frequently compare JSON with other data formats. Here’s how they stack up:

FeatureJSONXMLYAML
ReadabilityHighMediumVery High
VerbosityLowHigh (closing tags)Low
CommentsNot supportedSupportedSupported
Data types6 typesAll text~12 types
Parse speedVery fastSlowSlow
Browser nativeYes (JSON.parse)DOM parserNo
Primary useAPIs, configSOAP, RSSConfig, CI/CD

Where is JSON Used?

REST APIs

The standard response format for virtually all modern APIs.

Configuration files

package.json, tsconfig.json, eslint configs, VS Code settings.

Databases

MongoDB stores documents as BSON (binary JSON). PostgreSQL has jsonb columns.

WebSockets

Real-time messaging between client and server.

Local Storage

Browser localStorage/sessionStorage use JSON.stringify/parse.

Serverless & Cloud

AWS Lambda events, Terraform state, Kubernetes ConfigMaps.

Try It Yourself

Edit the JSON below and click Run & Validate to see if it parses correctly. Try adding new keys, changing values, or introducing an error to see what happens.

Try It Yourself

Modify the JSON and validate it instantly

Frequently Asked Questions

What does JSON stand for?
JSON stands for JavaScript Object Notation. Despite the name, JSON is language-independent and used in virtually every programming language.
Who invented JSON?
Douglas Crockford popularized JSON in the early 2000s. It was formally specified as ECMA-404 in 2013 and RFC 8259 in 2017.
Is JSON the same as JavaScript?
No. JSON syntax is a subset of JavaScript object literal syntax, but JSON is a pure data format. It cannot contain functions, comments, or executable code.
Why is JSON preferred over XML?
JSON is more compact, easier to read, faster to parse, and maps naturally to data structures in most programming languages. It also does not require closing tags or attributes.
Can JSON have comments?
Standard JSON (RFC 8259) does not support comments. However, extensions like JSON5 and JSONC (used in VS Code) do allow comments.