# What is JSON and how to open a .json file

> Learn what JSON is in plain words, what a .json file holds and how to open one on Windows, macOS, Linux, Android, iPhone or in a browser.

- URL: https://jsonstatham.dev/guides/what-is-json/
- Language: English (en)
- Russian version: https://jsonstatham.dev/ru/guides/what-is-json.md
- Updated: 2026-11-08

JSON is a text format for data: names, values and lists, written so that both people and programs can read them. A .json file is plain text, so any text editor opens it; the right tool also makes it readable. Below: what is inside, and what to open it with on each device.

## What JSON is, in plain words

JSON (JavaScript Object Notation) is a way to write data as text. Douglas Crockford described it in the early 2000s; today it is an internet standard, RFC 8259. The name mentions JavaScript, but the format belongs to no language: Python, Java, Go, PHP and C# read and write it just as well. A small example:

```json
{
  "name": "Anna",
  "age": 31,
  "email": null,
  "subscribed": true,
  "languages": ["en", "lv"],
  "address": { "city": "Riga", "zip": "1010" }
}
```

You meet .json files as API responses, app and editor settings, exports from services (Telegram Desktop saves a chat history export as `result.json`), browser bookmark backups, and `package.json` in every JavaScript project.

## How a JSON file is built

- An **object** in `{ }` holds pairs `"name": value`, separated by commas.
- An **array** in `[ ]` holds a list of values in order.
- A **string** is text in double quotes: `"Riga"`. Single quotes are not allowed.
- A **number** is written without quotes, with a dot for decimals: `31`, `-2.5`, `1e6`.
- `true`, `false` and `null` are written in lowercase, without quotes.
- Nothing else: no comments, no comma after the last item, no dates (a date is a string such as `"2026-11-08"`).

Spaces and line breaks between these pieces mean nothing. That is why the same data can be one long line or neatly indented: formatting changes only how it looks. RFC 8259 requires UTF-8 for JSON exchanged between systems.

## How to open a .json file

Decide first whether you want to read the file or change it. Anything that shows plain text can read it. To edit, use a code editor: it keeps the text exactly as typed, and colours mistakes.

| Device | To read it | To edit it |
| --- | --- | --- |
| Windows | Notepad (right-click > Open with) or a browser | VS Code, Notepad++ |
| macOS | Quick Look (select the file, press Space) or TextEdit | VS Code, BBEdit, Sublime Text |
| Linux | `less file.json`, `jq . file.json`, Firefox | VS Code, Kate, gedit, Vim |
| Android | A file manager that opens text, or our [formatter](https://jsonstatham.dev/) in the browser | A text editor app |
| iPhone, iPad | The Files app preview, or our [formatter](https://jsonstatham.dev/) in Safari | A text editor app |
| Any browser | Drag the file into a window: Firefox shows a tree, others show the text | Not for editing |

### Windows: open a .json file with Notepad

1. Right-click the file, choose **Open with**, then **Notepad**. If it isn’t in the list, pick **Choose another app**.
2. To open .json files this way every time, tick **Always use this app** (in Windows 11, press **Always**).
3. If the whole file is one long line, it is still fine: to read it, indent it ([how to pretty print JSON](https://jsonstatham.dev/guides/pretty-print-json/)).
4. Don’t edit JSON in Word: it replaces typed quotes with curly ones and saves in its own formats, which break the file ([smart quotes in JSON](https://jsonstatham.dev/errors/smart-quotes/)).

In a browser, drag the file into a window. Firefox opens .json with its built-in viewer: a tree with collapsible blocks, a Raw Data tab with Pretty Print, and a filter. Chrome and Safari show the plain text.

## Open and read a .json file online

Many .json files are a single line without spaces, because programs write them that way. To read one, open it in our [JSON Formatter](https://jsonstatham.dev/): drop the file on the page or press Ctrl/Cmd+O. It takes .json, .geojson and .txt files up to 1 MiB in UTF-8, indents them and has a Tree tab where blocks fold. A broken file gets its first error with a line and a column; the [Validator](https://jsonstatham.dev/validator/) explains it. The text goes to our API over HTTPS, is processed in memory and isn’t stored ([Security & data](https://jsonstatham.dev/security/)). On a phone, Open file picks from the phone’s storage.

For a big nested file, [JSON Viewer](https://jsonstatham.dev/viewer/) starts with the tree. If the formatter says the file isn’t UTF-8, re-save it as UTF-8: in Notepad, **File > Save as**, Encoding: UTF-8.

## When a .json file won’t open or looks wrong

- **Windows asks which app to use.** .json often has no default app. Pick Notepad or a code editor, as above.
- **The text is garbled.** The file is in another encoding (Windows-1251, UTF-16) or isn’t text at all, for example an archive named .json. Re-save text as UTF-8.
- **An app refuses to import it.** The file is probably broken: a missing bracket at the end, a trailing comma, single quotes or comments. The [Validator](https://jsonstatham.dev/validator/) shows the line and column.
- **The editor freezes.** Notepad struggles with files of hundreds of megabytes. Use `jq`, `less` or a code editor; our tools take up to 1 MiB.

## What is JSON: FAQ

### Is JSON a programming language?

No. It is a data format: text that describes values. It has no commands, loops or functions.

### Is it safe to open a .json file?

Reading it in a text editor or a browser is safe: it is plain text, and nothing in it runs. Whether to trust the data is up to the program that imports it later.

### How do I open a JSON file in Excel?

In Excel for Microsoft 365 on Windows: **Data > Get Data > From File > From JSON**, then turn the records into a table in the Power Query editor.

### What’s the difference between JSON, JSON Lines and YAML?

JSON is one document per file. [JSON Lines](https://jsonstatham.dev/guides/json-lines/) puts one JSON value on each line, for logs and big exports. YAML describes the same data with indentation and comments, for configs: [JSON vs YAML](https://jsonstatham.dev/guides/json-vs-yaml/).
