JSON Explained: The Data Format Behind the Web

JSON explained in plain terms means a simple text format that lets computers store and exchange structured data in a way both people and machines can read. The central question is how a website, a phone app, and a server can all understand the same piece of information, and the short answer is that JSON writes that information as labelled pairs of names and values, using a handful of clear rules that nearly every programming language already supports.

Every time a page loads fresh content without refreshing, a weather app updates its forecast, or an online shop shows live stock levels, JSON is usually carrying the data behind the scenes. The server sends a short block of text, the app reads the labels inside it, and the information appears on screen within a fraction of a second.

JSON stands for JavaScript Object Notation, and it grew out of the JavaScript language, though it has long since become independent of it. Today it is the standard way web services share data, and it also shows up in configuration files, databases, and messaging systems.

Key takeaways

  • JSON is a lightweight text format for storing and exchanging structured data, built from labelled name and value pairs.
  • It uses only a few building blocks, namely objects, arrays, strings, numbers, true and false values, and null.
  • Nearly every programming language can read and write JSON, which makes it the common language of web services.
  • JSON powers the data behind most modern websites and apps, travelling between browsers, servers, and APIs.
  • It is easy for people to read, easy for machines to parse, and strict about its syntax, so small errors can break it.

What JSON is

JSON is a way of writing data as text so that it can be saved in a file or sent across a network. A JSON document describes a single value, usually an object, which is a set of name and value pairs wrapped in curly brackets. Each name is a string in double quotes, followed by a colon, followed by the value, and pairs are separated by commas.

Values in JSON can be strings, numbers, true or false, null, another object, or an array, which is an ordered list of values inside square brackets. Arrays hold lists of things, such as the items in a shopping basket or the days in a forecast, while objects hold labelled facts, such as a person’s name or a product’s price. These two shapes nest inside each other to describe data of almost any complexity.

The format was first described by Douglas Crockford in the early 2000s, drawing on the object literal syntax of JavaScript. It was standardised in 2013 and has since become the default data format of the web, largely replacing an older, heavier format called XML for most new services. Our guide to REST APIs explains the services that most often send and receive JSON, and our guide to data analytics shows how the same format feeds the dashboards and reports that businesses use to understand their data.

How JSON works

When a browser asks a server for data, the server usually replies with a JSON document rather than a finished web page. The browser’s JavaScript reads that document, turns it into ordinary values the page can use, and updates only the parts of the screen that need to change. This is how a social feed loads new posts without the whole page reloading.

On the server side, the process runs in reverse. The server builds a JSON document from its database or its own calculations, sends it as plain text, and trusts the receiving program to interpret it. Because JSON is only text, it travels easily over the same connections that carry web pages, and it can be saved, copied, or logged with any text editor.

Parsing is the act of turning JSON text back into values a program can work with, and every major language provides a built-in tool for it. The parser checks that the brackets balance, the commas sit in the right places, and the quotes close properly, and if anything is wrong it reports an error instead of guessing. That strictness is a feature, since it stops malformed data causing quiet, hard-to-find mistakes further down the line.

A laptop on a dark desk with its screen showing glowing green nested data brackets
A laptop screen shows glowing green nested data brackets, the curly and square brackets that give JSON its shape, wrapping labelled values into objects and lists that any program can read.

The data types in JSON

JSON has only six kinds of value, and that small set is part of its appeal. Strings hold text, always in double quotes, such as a name, a city, or a message, while numbers hold quantities without quotes, whether whole numbers or decimals. The values true and false record yes-or-no facts, null means deliberately empty or unknown, and objects and arrays group the rest into structures.

It has no dedicated type for dates, so a date is usually written as a string in a standard form, and it cannot store comments, so notes for human readers must live elsewhere. It also has no binary data type, so images or files are sent separately or encoded as text, which makes the document larger.

These limits are deliberate trade-offs rather than oversights. By keeping the format small and simple, JSON stays fast to parse and easy to support in every language, and the things it leaves out are handled by agreed conventions rather than by extra syntax. A developer who learns these six types has learned almost everything the format has to offer.

Where JSON is used

Web APIs are the most common home of JSON. When an app asks a service for information, the service replies in JSON, whether the request is for search results, a user profile, or a train timetable. The app then displays that data, stores it, or passes it on, and the same API can serve a website, a phone app, and a partner company at once.

Configuration files are another everyday use. Many tools and services keep their settings in JSON files, from the setup of a website to the preferences of a code editor, because the format is easy for both people and programs to edit.

Databases and data pipelines also rely on JSON. Document databases store records directly as JSON-like documents, which suits data that does not fit neatly into rows and columns, and analytics systems pass JSON events from apps to warehouses where they are counted and studied. Even the browser uses JSON when it saves small pieces of data locally, such as a user’s preferences or a draft.

JSON compared with XML

XML was the dominant data format before JSON, and the two are often compared because they solve the same problem in different ways. XML wraps data in named tags, which makes it expressive but wordy, while JSON uses brackets and colons, which makes it shorter and closer to the data structures programmers already use. For most web work, that brevity won the argument.

The table below sets out the main contrasts.

Aspect JSON XML
Syntax Brackets, colons, and commas Opening and closing tags
Typical size Compact, less repeated markup Longer, tags repeat every value
Data types Strings, numbers, true, false, null Everything is text unless described
Readability Easy to scan at a glance Harder to read in large documents
Best suited to Web APIs and configuration Documents and strict standards
Comments Not supported Supported

XML still has a place where its strengths matter, such as in formal document standards, publishing workflows, and industries with long-established specifications. JSON, meanwhile, is the default choice for new web services, and most developers meet it long before they ever need XML.

Strengths and limits

The greatest strength of JSON is its simplicity. A beginner can read a JSON document and understand what it says without any special training, and a program can parse it in a few lines of code. That combination of human readability and machine efficiency is rare, and it is why the format spread so quickly once web services took off.

It is also genuinely universal. Whether the server runs Python, Java, Ruby, Go, or something else entirely, it can produce JSON, and whether the client is a browser, a phone, or another server, it can consume it. This shared format removes a layer of translation work and lets teams build services anyone can connect to.

The limits are the price of that simplicity. JSON has no way to describe the shape of valid data on its own, so services rely on separate schema documents or documentation to explain what fields to expect. It is also a poor fit for very large documents, where parsing the whole text at once uses a lot of memory, and it carries no security features, so data must be checked before it is trusted.

JSON checklist

  • Check that every opening bracket has a matching closing bracket before saving a JSON file.
  • Use double quotes for all strings, since single quotes are not valid in JSON.
  • Remove any trailing comma after the last item in an object or array.
  • Validate a JSON document with a parser or an online validator before sending it to a service.
  • Keep numbers unquoted and strings quoted, so each value keeps its proper type.
  • Use null for a value that is deliberately empty, rather than leaving the field out without a plan.
  • Agree the field names and types with everyone who will read the data, and write them down.
  • Never trust JSON received from an unknown source until it has been checked and cleaned.
  • Keep sensitive information out of JSON logs, since the text is easy for anyone to read.

Frequently asked questions

What does JSON stand for?

JSON stands for JavaScript Object Notation. It takes its name from the JavaScript language, whose object syntax inspired it, but it is now a language-independent format used by programs written in every major language.

Is JSON a programming language?

No, JSON is a data format, not a programming language. It cannot run instructions, make decisions, or perform calculations, and it only describes data, which programs then read and act upon.

How is JSON different from JavaScript?

JavaScript is a full programming language that can run code, while JSON is only a text format for data. A JSON document looks like a piece of JavaScript, but it follows stricter rules, such as requiring double quotes around every name and forbidding functions.

Why do APIs use JSON?

APIs use JSON because it is compact, easy to read, and supported by nearly every programming language. It lets a service send structured data to any client, from a browser to a phone app, without either side knowing what language the other uses.

Can JSON store images or files?

Not directly, since JSON only holds text and numbers. Files and images are usually sent separately, or encoded as text inside a string, which works but makes the document larger and is best avoided for anything sizeable.

What happens if JSON has a syntax error?

The parser rejects the whole document and reports an error, rather than trying to guess what was meant. This is why a single missing comma or unmatched bracket can stop an app loading its data, and why validating JSON before use is good practice.

The bottom line

JSON is the quiet workhorse of the modern web, a small format that carries the data behind almost everything we do online. Its strength lies in doing one job well, writing structured data as plain text that people can read and machines can parse.

For anyone building or using web services, understanding JSON is time well spent. Learn its six value types, respect its strict syntax, and it will repay the effort every time a page updates, an app syncs, or two systems need to share information.

Latest articles

Scroll to Top