What is a JSON file?
A JSON file is a plain text file that stores structured data — lists, settings, records — in a format both people and programs can read. It normally ends in .json, and you can open it in any text editor. JSON stands for JavaScript Object Notation.
It is not a program, a database or a compressed archive. There is nothing to install to read one. If you have a .json file and just want to look inside it, paste it into the JSON viewer — or read how to open a JSON file for every other way.
What one actually looks like
Here is a small JSON file on the left, and the same file as a tree on the right. The tree is the easier way to read one: click a row to open or close it.
{
"name": "Ada Lovelace",
"age": 36,
"isMathematician": true,
"languages": ["English", "French"],
"address": {
"city": "London",
"country": "England"
},
"nickname": null
}Both panes show identical data. The braces and brackets on the left are the same nesting the tree shows on the right — that is all a JSON file is.
The six types, and that is the whole language
JSON is deliberately tiny. There are six kinds of value and no others — no dates, no comments, no functions, no undefined.
| Type | Example | Worth knowing |
|---|---|---|
| String | "Ada Lovelace" | Text. Always double quotes — single quotes are not valid JSON. |
| Number | 36 | No quotes. There is no separate integer and decimal type. |
| Boolean | true | Lowercase true or false. Not True, not TRUE, not yes. |
| Null | null | Deliberately empty. Different from a missing key or an empty string. |
| Array | ["English", "French"] | An ordered list, in square brackets. |
| Object | { "city": "London" } | Key/value pairs, in curly braces. Keys are always strings. |
“Jason file” — you mean JSON
If you searched for a Jason file, this is the page you wanted. JSON is pronounced like the name — most people say “JAY-son”, some say “JAY-sawn” — so it is very commonly written down as the name by mistake. The format is always spelled JSON, and a file called data.jason is simply a misspelled filename: rename it to data.json and nothing else changes.
What JSON stands for, and where it came from
JavaScript Object Notation. It was specified by Douglas Crockford in the early 2000s, borrowing the way JavaScript writes objects — but it is not JavaScript and it is not tied to it. Every mainstream language reads and writes JSON, which is exactly why it became the default way programs exchange data.
The name is the only JavaScript thing left about it. A Python service talking to a Go service will very likely be sending JSON.
Where you run into JSON files
- Configuration.
package.json,tsconfig.json, VS Code settings, app manifests. - API responses. Almost every web service answers in JSON.
- Data exports. Downloading your data from a service usually gives you JSON — Google Takeout, Twitter/X archives, Discord exports.
- Saved state. Games and desktop apps often keep settings and save files as JSON, which is why one turns up when you go looking in an app folder.
JSON vs the formats it replaced
vs XML: JSON says the same thing in far fewer characters and maps directly onto the data structures programming languages already have. XML has attributes, namespaces and schemas; JSON has six types.
vs CSV: CSV is a flat grid, so it cannot express something inside something else. JSON nests, which is why an address can sit inside a person.
vs YAML: YAML is largely JSON with the punctuation removed and comments added, which makes it nicer to hand-write and fussier about indentation. Any JSON file is already valid YAML — you can convert JSON to YAML and back to see it.
The three things that break a JSON file
JSON is strict, and almost every “invalid JSON” error is one of these:
- A trailing comma after the last item. Legal in JavaScript, not in JSON.
- Single quotes.
{'a': 1}is not JSON;{"a": 1}is. - Comments. There is no way to write one.
//and/* */both make the file invalid.
If a file will not parse, the JSON validator gives the exact line and column and can repair all three of those automatically, and the JSON error reference explains what each parser message actually means.
Common questions
- Is a JSON file safe to open?
- Yes. It is plain text and contains no code that can run. Opening one is as safe as opening a
.txtfile — what you do with the data afterwards is the only thing worth thinking about. - Can I edit a JSON file by hand?
- Yes, in any text editor — but check it afterwards, because a single missing comma breaks the whole file and the error is usually reported a line or two after the real mistake.
- Why is my JSON file all on one line?
- Because whitespace does not matter to a program, so services usually strip it to save bandwidth. Run it through the JSON formatter to get it back onto readable lines. Nothing about the data changes.
- Is JSON the same as a JavaScript object?
- No, and the difference catches people out. JSON keys must be double-quoted strings, and JSON has no dates, functions, comments or
undefined. It is a text format that happens to look like JavaScript.
Every tool linked from this page runs entirely in your browser. Nothing you paste is uploaded, stored or logged.