# JSON guides

> Read practical JSON guides: big numbers and BigInt, key order, comments, pretty printing, JSON Lines, JSON vs YAML and what a .json file is.

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

Guides to the parts of JSON that trip people up: what a JSON file is and how to format it, big numbers that change value, keys that change places, comments that aren’t allowed, one value per line, and YAML. Each one shows what real parsers print and how to get the result you meant.

## All JSON guides

| Guide | What it answers |
| --- | --- |
| [What is JSON and how to open a .json file](https://jsonstatham.dev/guides/what-is-json/) | What the format is, what a `.json` file holds and how to open one on Windows, macOS, Linux, Android, iPhone or in a browser. |
| [How to pretty print JSON](https://jsonstatham.dev/guides/pretty-print-json/) | Formatting JSON in Python, jq, JavaScript, Go and PowerShell, in VS Code, Notepad++, IntelliJ and Sublime Text, or online. |
| [Big numbers in JSON: BigInt, precision and JSON.parse](https://jsonstatham.dev/guides/json-big-numbers/) | Why `JSON.parse` rounds `12345678901234567890` and drops the zero in `1.10`, what “Do not know how to serialize a BigInt” means, and how to keep numbers exact in JavaScript, Python, Go and Java. |
| [JSON key order: why numeric keys jump ahead](https://jsonstatham.dev/guides/json-key-order/) | Why JavaScript moves numeric keys to the front, why sorting tools put `"10"` before `"2"`, and when order matters. |
| [Can JSON have comments? JSONC, JSON5 and workarounds](https://jsonstatham.dev/guides/json-comments/) | Why JSON has no comments, what JSONC and JSON5 allow, and how to annotate a file or strip comments before parsing. |
| [JSON Lines (NDJSON): what it is and how to read it](https://jsonstatham.dev/guides/json-lines/) | One JSON value per line, why `json.load` fails with “Extra data”, and how to read and write such files in Python, JavaScript, Go and jq. |
| [JSON vs YAML: differences, traps and when to use each](https://jsonstatham.dev/guides/json-vs-yaml/) | Syntax, comments, anchors, the YAML 1.1 Norway problem, numbers, and when to choose which format. |

## JSON errors and tools

Looking at a specific error message, such as “Unexpected token” or “Expecting value”? The [JSON errors](https://jsonstatham.dev/errors/) reference explains each one by cause, with the exact text from each parser. To check a document now, use the [Validator](https://jsonstatham.dev/validator/); to format it, the [Formatter](https://jsonstatham.dev/).

## JSON guides FAQ

### Which JSON rules do these guides follow?

Strict JSON as [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259) defines it, the same rules the [Validator](https://jsonstatham.dev/validator/) applies. JSONC, JSON5 and JSON Lines are covered as separate formats, with what each one adds.

### Why does the same JSON come out differently in different tools?

Most tools parse the text into values and print the values back. On the way numbers become doubles, objects lose their key order and comments become errors. The guides show where each of these happens and how to avoid it.

### Can I run the examples myself?

Yes. Each example says which parser and version printed the output, so you can repeat it with Node.js, Python, Go, Java or jq, or paste the same JSON into the [Formatter](https://jsonstatham.dev/) to compare.
