Tools
EN

What Is JSON?

JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging data. It is easy for people to read and for programs to parse, which has made it the standard format of web APIs, configuration files and data exports.

JSON meaning and a first example

JSON stands for JavaScript Object Notation. It was popularised by Douglas Crockford in the early 2000s, borrows its syntax from JavaScript and is standardised as RFC 8259 and ECMA-404. Despite the name, JSON is independent of any programming language: practically every language can read and write it.

A small JSON document describing a person:

{"name": "Ada Lovelace", "born": 1815, "languages": ["English", "French"], "mathematician": true, "spouse": null}

JSON data types

TypeExampleNotes
String"Hello"text in double quotes, with escapes such as \n
Number42, -3.14, 6.02e23no NaN, Infinity, hexadecimal or leading zeros
Booleantrue, falsealways lowercase
Nullnullan empty or unknown value
Object{"key": "value"}name/value pairs; the names are strings
Array[1, 2, 3]an ordered list of values of any type

JSON has no date type: dates are usually written as ISO 8601 strings such as "2026-05-01T10:00:00Z".

JSON format: the syntax rules

What is a JSON file?

A JSON file is a plain-text file with the .json extension that contains one JSON document. Its media type is application/json, and it should be saved as UTF-8. Typical JSON files are data exports from apps and websites (for example Google Takeout or social-media downloads), configuration files such as package.json, API responses saved to disk and data sets for analysis. Because it is plain text, a JSON file is safe to open – it cannot run code.

How to open a JSON file

WhereHow
WindowsRight-click the file → Open with → Notepad, or use a code editor such as VS Code. Dragging the file into a browser window shows it too.
MacOpen it with TextEdit or a code editor, or drop it onto a browser window.
iPhone and AndroidOpen it from the Files app in a text viewer, or load it into an online JSON viewer – ours works on phones and the file stays on your device.
Web browserFirefox has a built-in JSON viewer; in any browser, an online JSON viewer shows the data as a collapsible tree.
ExcelUse Data → Get Data → From File → From JSON on Windows, or convert the file with JSON to CSV first.

JSON vs XML

JSONXML
Syntaxbraces, brackets, name/value pairsopening and closing tags
Data typesstring, number, boolean, null, object, arraytext only, unless a schema defines types
Sizecompactlarger because of closing tags
Commentsnoyes
Attributes, namespacesnoyes
Typical useweb APIs, configuration, NoSQL databasesdocuments, office files, SOAP and enterprise systems

JSON in APIs and applications

Most web APIs send and receive JSON. A client sends a request with the header Content-Type: application/json, the server answers with JSON, and the program turns it into native objects with JSON.parse in JavaScript, json.loads in Python or json_decode in PHP. JSON also powers configuration files such as package.json and tsconfig.json, document databases such as MongoDB, and the structured output of AI models.

Common JSON errors

Paste your data into the JSON validator to see the exact line and column of the problem, or let Repair fix it automatically.

JSON5, JSONC and JSON Lines

Frequently asked questions

Is JSON a programming language?

No. JSON is a data format: it describes data but cannot contain logic, functions or comments.

Is JSON the same as a JavaScript object?

No. JSON is text that looks like a JavaScript object literal, but it is stricter: keys and strings need double quotes, and functions, undefined and comments are not allowed. JSON.parse turns the text into a real object.

How do I create a JSON file?

Write the data in any text editor following the rules above and save it as UTF-8 with the .json extension. Check it with a JSON validator before you use it.

Updated: