How to open a .json file

It is text, so everything opens it. Reading it is the part that needs help.

What it is

A `.json` file holds structured data: objects with named fields, lists of things, numbers and strings. It is the format an API answers in and the one most applications export their settings to, which is why one turns up in a download folder without explanation.

Opening it

Dragging it into a browser window works well: Firefox and Chrome both show a folding, searchable view rather than raw text. VS Code opens it with folding and will reformat a single-line file with one command.

A very large export — tens of megabytes — will make an editor struggle. A command-line tool such as `jq` reads those without loading the whole file into a window.

When it will not parse

The three usual faults are a trailing comma after the last item, single quotes where the format requires double, and a comment — JSON has no comments, whatever the file it came from looked like.

An error naming a line and column is worth trusting: the parser stopped exactly there, and the fault is usually one character earlier.

Making it readable by a person

A folding viewer is for inspecting data. When the point is to show it to somebody, converting to Markdown turns a list of records into a table and nested objects into headed sections — the same information, in a shape that survives being pasted into a document.