JSON is a simple text format for representing data in an orderly way, so that two programs can exchange it. The acronym stands for JavaScript Object Notation. It is lightweight, easy for a person to read and easy for a machine to process, which is why it has become the common language of most communication on the internet.
Every time a weather app shows you the forecast, a shop checks the status of a delivery or a map loads nearby businesses, data travels from one server to another. Most of the time it travels in this format. It is the equivalent of a properly filled-in form, with named fields and their values, that anyone can understand without ambiguity.
JSON is the standard form that programs use to pass information to each other. It is short, clear and everybody understands it.
What is JSON?
JSON exists because, when two programs communicate, they need to agree on how to write the data. If one sends information in a format the other does not understand, communication fails. An exchange format is that agreement. It defines how names, numbers, text and lists are written, so that any program can read them without errors or doubtful interpretations.
The structure of this format is very simple. Data is organised into pairs made up of a name and a value, such as customer and their name, or price and its amount. These can be grouped into sets and lists to represent more complex things, such as an order with several products. With these few pieces almost any information in an application can be described.

As it is just text, it can be opened and read with any editor. This is a great advantage when debugging, because whoever works with it can see exactly what was sent. Unlike binary formats, which only machines understand, here there is transparency. That clarity has been key to its success among developers all over the world.
Syntax of objects, arrays and values
A JSON document is built from very few pieces. The basic one is the pair formed by a name and a value, for example the customer’s name and its value. Several pairs form an object, such as a customer record, and several objects form a list, such as the set of all customers. Objects are written between curly braces and lists, also called arrays, between square brackets.
The rules for writing JSON are strict and leave little room for error. Names always go in double quotes, the name and the value are separated by a colon and each pair is separated from the next by a comma. That simplicity is its strength, because a person with no technical training can read a JSON document and understand what it contains, and every programming language knows how to read and write it.
JSON data types
The values in a JSON document support six data types, and combining them makes it possible to represent structures as complex as an order with its products, the customer and the delivery address.
Text strings
JSON text strings always go in double quotes and accept any Unicode character. Special characters are written with a backslash in front, such as a line break or the quotation marks themselves, and an accented letter can appear as it is or as its code, for example é for the letter é.
Numbers
JSON numbers are written without quotes, such as 42, 3.5 or -1.2e3, and they do not distinguish between integers and decimals. The standard does not set the precision, so a very long identifier can lose its last digits when read in JavaScript, which is why many APIs send those identifiers as text.
Boolean and null values
The Boolean values of JSON are true and false, always in lowercase, and the empty value is written null. They are used, for example, to indicate whether a product is on sale or whether a customer has no phone number registered yet, without inventing special values.
Objects
A JSON object is a set of name and value pairs between curly braces, such as a customer record with their name, email and sign-up date. Objects can contain other objects, so the delivery address can be an object inside the order.
Arrays or lists
A JSON array is an ordered list of values between square brackets, which can be of any type, including other objects. The list of products in an order, with their reference, quantity and price, is the typical example.
Advantages of JSON over XML and other formats
Less text, less weight
The same information takes up considerably less space in this format than in its competitor. That means shorter messages that travel faster and use less data. On a website with thousands of requests per minute, the difference shows in the server bill and in the speed the visitor perceives. On phones with weak connections, even more so. In addition, the information is easier for developers to handle. Modern languages can read and write it with a single instruction, without intermediate steps. This reduces errors and speeds up development. When a tool is convenient to use, it spreads quickly, and in this case convenience was decisive in displacing the previous format.
Clearer for people
When a person opens a message in this format, they understand what it contains without any special training. Field names are common words, and the structure is clean. This makes it easier for different teams to collaborate, and for faults to be spotted by reviewing the data. A readable format is also a format that is easier to audit and to correct.
Compatible with everything
Although it was born tied to JavaScript, today practically every language understands it. A server written in one language can talk to an application written in another without any problems.
This universality is what has turned it into the common language of programming interfaces. Anyone offering a service on the internet knows that, by using this format, anyone will be able to connect.
Universality also makes it easier to switch providers. If data is stored and exported in an open, standard format, it is much easier to move it to another system. That is why it is a useful criterion when choosing tools. If a service does not let you export your data in a standard format, it is a sign that you could end up trapped.
Compared with YAML, CSV and HTML
XML is not the only rival of JSON as a data format. YAML, widely used in configuration files, is even more readable because it does without braces and quotation marks and allows comments, and since version 1.2 any valid JSON is also valid YAML. CSV is more compact for flat tables, such as a spreadsheet, but it cannot represent nested data. HTML does not compete with it, because it describes how a page is presented and is not meant to carry data. When size matters a lot, binary variants such as BSON, MessagePack or Protocol Buffers are used. A WordPress developer knows when to use these pieces and how to integrate them without breaking what already works.
What the format is used for and the care it requires
JSON in APIs and in the browser
The most widespread use is in programming interfaces. When a mobile app or a web page asks a server for data, the response almost always arrives in this format, with the content type application/json. In the browser, JavaScript converts it into objects with JSON.parse() and does the reverse with JSON.stringify(), and most languages have equivalent functions, such as Python’s json module or json_decode() in PHP. In systems such as WordPress, Drupal or Joomla and in shop platforms such as Shopify or PrestaShop, the REST interface, the editors and many extensions use it constantly. Knowing these uses helps you understand why a website can expose data without anyone having built a page to display it.

JSON in configuration files and databases
Many programs store their settings in files with the .json extension, such as the package.json that describes a Node.js project or the composer.json of PHP projects. Document databases, such as MongoDB or CouchDB, store records in this same shape, and relational databases support it too, such as PostgreSQL with its jsonb type or MySQL with its JSON type. A text editor is all you need to open a JSON file, although browsers and code editors display it with colours and indentation that make it easier to read.
JSON-LD and structured data
The structured data that helps search engines understand a page, such as ratings, products, recipes or FAQs, is usually written in JSON-LD, a variant designed for linking data. It has been a W3C recommendation since 2014 and it uses the Schema.org vocabulary. Google recommends JSON-LD as its preferred format because it sits in a separate block of the page’s code and does not require changes to its visible content.
Privacy and security of exchanged data
The format is just text and poses no danger on its own. The problems appear in how it is used. A very common mistake is for an interface to return more information than necessary, for example a user’s complete details when only their name was needed. If that interface is public, anyone can read that data, even though the website’s screens do not show it.
There are cases of apps and websites that exposed the email addresses, phone numbers and even hashed passwords of thousands of users for this reason. The data was not stolen through a sophisticated attack, it was simply visible in the server’s responses. In WordPress, for example, for years the list of a website’s users could be queried from its public interface, and in many custom developments something similar happens when the interface returns the complete record instead of the necessary fields, which helps attackers prepare login attempts.
Good practice is to return only what is needed, always check who is requesting each piece of data and never blindly trust what is received. Data that comes from outside must be validated as if it could be malicious. And responses containing sensitive information must require authentication. These are basic measures that prevent most incidents related to this kind of exchange.
Limitations and common mistakes
The most frequent mistakes are syntax errors, such as a stray comma, a quotation mark that is never closed or a value left unquoted where quotes are needed. A program that receives invalid JSON will not usually guess what was meant, it simply fails. That is why documents should be validated with automated tools before they are used.
The format does not allow comments either, nor does it have its own type for dates, which are stored as text in agreed formats such as ISO 8601. To check that a document contains the expected fields and types, JSON Schema is used, a specification that describes, in another document of the same format, which data is valid.
Another limitation of JSON is the size of documents. A huge JSON document, with thousands of records, takes time to transmit and process, and on a website it can slow down loading. The solution is to request only what is needed and to paginate the results.
What data a website exposes in its structured responses
A simple approach is to ask your provider or your technical team for a list of your website’s public interfaces and the information each one returns. Many owners are surprised to discover which data can be accessed from outside. This review takes an hour and can prevent serious privacy problems and exposures that nobody had anticipated.
It is also worth reviewing the extensions and modules that publish data in JSON. Some add their own interfaces and expose customer, order or form information without the owner knowing. If an extension is no longer used, it is uninstalled. If it is used, you check that its data is only visible to the right people. It is another reason to keep the list of extensions short and up to date.
Contact forms are a useful example of this risk. Many store every message with the name, email and phone number, and some offer an interface to query them from other applications. If that door is left open without protection, anyone could read your customers’ messages. Checking who can see what is one of the quickest reviews and one of the most worthwhile you can do.
Finally, always keep the data protection regulations in mind. If your website processes personal data, you need to know where it is stored and who can access it. Exchange formats are part of that journey. Documenting which data travels and where it goes is a sensible requirement, and it helps you respond clearly if a customer or the supervisory authority asks.
The origin of the JSON format
In the early 2000s, the dominant format for exchanging data was XML, a flexible but verbose language. Every piece of data needed opening and closing tags, which made messages long and heavy. Web developers were looking for something simpler, and Douglas Crockford noticed that the way JavaScript wrote its own data was perfectly suited to the task. Crockford has always insisted that he did not invent it, he discovered it. As he explained in 2008, he identified it in the spring of 2001, gave it a name and created a website to explain it. Others had already used it informally before.
His contribution was to recognise its value, define its rules and spread it, something that is sometimes as important as inventing.
Over time, the JSON format became an official standard. In 2006 a first technical description was published in a document from the organisation that defines internet standards. In 2013, Ecma International published its own standard, and in 2017 the current version of the internet document arrived, declaring it a standard. Today it is one of the few formats backed by several international organisations.
That formalisation matters a great deal more than it seems. When a format is clearly defined in public documents, companies can build products that understand each other without the need for special agreements. That is what allows a shop, a delivery service and a bank, created by different teams, to exchange information without anyone having to translate between them.