What Is a JSON File and How Do You Open One?
Short answer
A JSON file is plain text storing structured data as nested key-value pairs. Open it with any text editor, whether Notepad on Windows or TextEdit on Mac, or drop it into a formatter to add the line breaks and indentation that make it readable. No special software is required, and you should not need to install anything.
On this page
A JSON file is a text file. Open it in Notepad and you will see everything it contains, because there is nothing else in there: no compression, no binary blob, no proprietary wrapper.
JSON stands for JavaScript Object Notation. It originated in JavaScript but is now the default way almost every web service exchanges structured data, and the format every modern language can read. If an app exported your settings, your data or an account archive, there is a good chance it handed you JSON.
What is actually in the file
JSON stores data as nested pairs of a name and a value. Four punctuation marks carry the entire structure:
| Symbol | Meaning |
|---|---|
{ } |
An object, a group of named fields |
[ ] |
An array, an ordered list of items |
: |
Separates a field name from its value |
, |
Separates one field or item from the next |
A small example, formatted:
{
"name": "Priya Raman",
"active": true,
"visits": 14,
"tags": ["billing", "priority"],
"address": {
"city": "Leeds",
"postcode": "LS1 4AP"
}
}
Field names are always in double quotes. Values can be a string in double
quotes, a number without quotes, true, false, null, another object, or an
array. That is the complete list of types, which is why the format is easy for
programs to parse and awkward for storing anything it was not designed for, such
as dates, which are conventionally written as strings.
Indentation and line breaks are decorative. The same data on one unbroken line is equally valid and equally machine-readable, which is exactly why the file you have been sent is probably unreadable.
Opening one
The file is text, so a text editor is the correct tool.
- Windows: right-click → Open with → Notepad. For anything over a few hundred lines, Notepad struggles; Notepad++ or VS Code handle large files and colour the syntax.
- macOS: right-click → Open With → TextEdit. VS Code or BBEdit for larger files.
- iPhone and Android: most files apps preview JSON as text. Otherwise email it to yourself and open it in a browser.
- Any browser: drag the file onto a Chrome or Firefox window. Both render JSON as a collapsible tree with expandable sections, which beats a text editor for exploring a large structure.
To stop double-clicking from opening it in the wrong place, change the default association: on Windows, right-click → Open with → Choose another app → tick Always use this app.
Making an unreadable one readable
Machine-generated JSON frequently arrives as a single line tens of thousands of characters long. This is called minified JSON, and it saves bandwidth at the cost of being impossible to read.
Paste it into the JSON formatter and it comes back with line breaks and indentation, which is the one step that turns an unreadable file into an obvious one. The formatter also validates as it goes, so a syntax error is reported with its position rather than discovered later.
Do this entirely in the browser where the data is sensitive. Any tool that uploads the file to a server has, by definition, seen the file. And JSON exports from banking, health or account systems are precisely the ones you should not paste into an arbitrary website.
Browsers do a decent job too. Chrome and Firefox pretty-print JSON automatically when the content type is right, and offer a Raw toggle to see the original.
Why yours will not parse
JSON is strict in ways that catch people out. The failures cluster:
A trailing comma. ["a", "b",] is invalid. JavaScript tolerates this;
JSON does not. The most common error by a wide margin.
Single quotes. {'name': 'x'} is invalid. JSON requires double quotes on
both names and string values.
An unescaped quote or backslash inside a string. A Windows path written as
"C:\Users\me" breaks, because \U is read as an escape sequence. It must be
"C:\\Users\\me".
Comments. JSON has no comment syntax. A // line will fail every parser,
even though some config files that call themselves JSON accept them through
non-standard extensions.
A byte order mark. An invisible marker some Windows editors write at the start of a file. Strict parsers reject it, and you cannot see it, which makes this the most frustrating of the five. Saving as UTF-8 without BOM fixes it.
JSON Lines, and other near-relatives
If your file has one complete JSON object per line with no wrapping array, it is
JSON Lines, often with a .jsonl or .ndjson extension, sometimes still
.json. Log exports and data dumps use it because each line can be processed
independently. A standard formatter will reject the whole file; feed it one line
at a time.
.geojson is ordinary JSON with an agreed structure for map data. .json5 and
.jsonc are relaxed variants that permit comments and trailing commas, used for
configuration files. Any of these may open fine in a text editor and fail in a
strict parser.
Realistic expectations
For reading, the browser and a formatter cover nearly everything. A 200MB export is the exception — most editors and all browser-based formatters will choke on it, and that genuinely does call for a command-line tool or a developer’s editor built for large files.
For editing, change one value at a time and re-validate. JSON gives poor error messages relative to how easy it is to break, and a missing brace five hundred lines up reports as an error at the end of the file. Keeping a copy of the original before you edit is worth the ten seconds, in the same spirit as recovering an earlier version of a file when an edit goes wrong.