What Is JSON? A Beginner's Guide

If you’ve spent any time around websites, APIs, or configuration files, you’ve almost certainly run into JSON — often as a wall of curly braces and quotation marks that looks more intimidating than it is. JSON is, in fact, one of the simplest data formats ever designed, and that simplicity is exactly why it took over the web. This guide explains what JSON is, how it’s built, the rules you have to follow, and where you’ll meet it in the wild — no programming background required.

What does JSON stand for?

JSON stands for JavaScript Object Notation. It was derived from the way JavaScript writes objects, but despite the name it is completely language-independent. Today JSON is read and written by virtually every programming language — Python, Java, C#, Go, PHP, Ruby, and dozens more — which is a big part of why it became the default format for moving data around the internet.

At its core, JSON is just text. That’s the whole trick. Because it’s plain text, any system can produce it, any system can read it, and a human can open it in a text editor and understand it. It’s designed to be both easy for machines to parse and easy for people to read.

What is JSON used for?

JSON’s job is data interchange — storing data and passing it between programs. You’ll find it almost everywhere:

Use caseExample
Web APIsA weather service returns today’s forecast as JSON
Configuration filespackage.json, tsconfig.json, VS Code settings
DatabasesDocument stores like MongoDB save records as JSON-like documents
Mobile appsAn app fetches your feed from a server as JSON
Data exportExporting settings, analytics, or records between tools

Whenever two systems need to agree on a way to represent structured data — a user profile, a list of products, a set of settings — JSON is usually the answer.

How JSON is structured

JSON is built from two core structures that nest inside each other:

  1. Objects — collections of key/value pairs, wrapped in curly braces { }
  2. Arrays — ordered lists of values, wrapped in square brackets [ ]

Here’s a simple object describing a person:

{
  "name": "Ada Lovelace",
  "age": 36,
  "isMathematician": true,
  "languages": ["English", "French"],
  "address": {
    "city": "London",
    "country": "UK"
  }
}

Read it top to bottom and it almost explains itself. Each key (the part in quotes on the left) is paired with a value (on the right) using a colon. Pairs are separated by commas.

The data types JSON supports

JSON values can only be one of six types. That deliberate smallness is part of why it’s so portable:

TypeExampleNotes
String"hello"Always in double quotes
Number42, 3.14, -7No quotes; integers and decimals
Booleantrue, falseLowercase only
NullnullRepresents “no value”
Object{ "key": "value" }Nested key/value pairs
Array[1, 2, 3]Ordered list of any values

Notice what’s not there: no dates, no comments, no functions. A date in JSON is just a string (usually in ISO format like "2026-06-23"), and your program decides how to interpret it.

The rules you have to follow

JSON is strict. A single misplaced character will make the whole document invalid, which is the most common frustration for beginners. The rules are short, though:

  • Keys must be strings in double quotes. "name" is valid; name and 'name' are not.
  • Strings use double quotes, never single. 'hello' is invalid JSON even though it’s fine in many programming languages.
  • No trailing commas. A comma after the last item in an object or array breaks it.
  • No comments. JSON has no // or /* */ syntax. If you see comments, it’s a relaxed variant (like JSONC), not strict JSON.
  • Use the exact literals true, false, and null — lowercase, unquoted.

A quick before/after

Here’s invalid JSON, with three classic mistakes:

{
  name: 'Ada',        // single quotes + unquoted key
  "age": 36,          // a comment, which JSON forbids
  "languages": ["English", "French",],   // trailing comma
}

And the corrected version:

{
  "name": "Ada",
  "age": 36,
  "languages": ["English", "French"]
}

If you’re ever unsure whether your JSON is valid, paste it into the JSON formatter. It validates the structure and points to the exact line where something is wrong — far faster than hunting for a stray comma by eye. We dig into the most frequent errors in how to format and beautify JSON.

Reading nested JSON

Real-world JSON is rarely flat — objects contain arrays, which contain more objects. The key to reading it is to follow the indentation. Here’s a small response that lists two books:

{
  "library": "City Central",
  "books": [
    {
      "title": "The Pragmatic Programmer",
      "year": 1999,
      "available": true
    },
    {
      "title": "Clean Code",
      "year": 2008,
      "available": false
    }
  ]
}

To find whether Clean Code is available, you read: the top object has a books array → the second item in that array → its available key → false. Once you internalize that objects hold named values and arrays hold ordered values, even deeply nested JSON becomes navigable.

Indentation like this isn’t required by the JSON spec — the data would be identical on one long line — but it makes the structure readable to humans. Turning a compressed blob into this readable, indented shape is called beautifying or pretty-printing, and it’s the single most useful thing you can do to messy JSON.

JSON vs other formats

JSON isn’t the only data format, but it hit a sweet spot the others missed:

FormatStrengthsWeaknesses
JSONCompact, readable, native to the webNo comments, strict syntax
XMLVery expressive, supports attributesVerbose, heavier to parse
YAMLHuman-friendly, allows commentsWhitespace-sensitive, easy to misindent
CSVTiny, great for tablesOnly flat data, no nesting

For sending structured data between a browser and a server, JSON’s combination of small size, readability, and universal support is hard to beat — which is why it quietly became the lingua franca of modern APIs.

How to work with JSON as a beginner

You don’t need to be a developer to handle JSON. A practical workflow:

  1. Open it in a tool that understands structure. Pasting raw JSON into the JSON formatter instantly indents it and surfaces errors.
  2. Beautify before reading. A minified one-line blob is unreadable; pretty-printing it reveals the shape.
  3. Validate before sending. If you’re editing a config file by hand, validate it so a stray comma doesn’t break your app.
  4. Minify before shipping. When size matters (loading a web page), collapse the whitespace back out — the JSON formatter does this too.

If your JSON contains long encoded blobs, you may also run into Base64 strings or percent-encoded URLs inside the values — both are common companions to JSON in API responses.

The bottom line

JSON is a lightweight, text-based format for storing and exchanging structured data, built from just two structures — objects ({ }) and arrays ([ ]) — and six value types. Its rules are strict but few: double-quoted keys, double-quoted strings, no trailing commas, no comments. That deliberate simplicity is why it became the standard way data moves across the web. When you meet JSON in the wild, paste it into the JSON formatter to indent it, validate it, and read it with ease.

Frequently Asked Questions

What does JSON stand for?

JSON stands for JavaScript Object Notation. It originated from JavaScript’s object syntax but is now a language-independent format used by nearly every programming language for storing and exchanging data.

Is JSON a programming language?

No. JSON is a data format, not a programming language. It has no logic, functions, or commands — it only describes data. Programming languages read and write JSON, but JSON itself does nothing on its own.

What’s the difference between JSON and JavaScript?

JavaScript is a full programming language; JSON is just a text format for data that happens to look like JavaScript objects. All JSON is valid JavaScript notation, but JSON is far more restrictive — it allows only data, with strict rules like double-quoted keys and no comments.

Can JSON have comments?

No. Standard JSON does not support comments. If you need comments in a config file, some tools use relaxed variants like JSONC or JSON5, but those are not valid strict JSON and won’t parse everywhere.

How do I know if my JSON is valid?

Paste it into a validator like the JSON formatter. It checks the syntax and tells you the exact line and reason if something is wrong — usually a missing quote, a trailing comma, or a misplaced bracket.

Because it’s simple, compact, human-readable, and supported by every major programming language. That combination makes it the easiest reliable way to move structured data between a server and a browser, which is why most web APIs return JSON.