How to Open a JSON File
You downloaded a file ending in .json — a data export, an API response, a config file, a backup from an app you're leaving — and double-clicking it either did nothing, opened a browser tab full of unreadable text, or asked you which program to use. Nothing is broken. JSON is a plain-text format with no default app attached to it on most systems.
The fastest fix is a viewer that shows the structure rather than the raw text. Paste it into FileNaut's JSON Viewer and you get a collapsible, colour-coded tree you expand one branch at a time — in your browser, with the file never leaving your device. This guide covers that, the desktop options, how to read what you're looking at, what to do when the file is too big for a text editor, and how to decode the error when it won't open at all.
H2: What a JSON file actually is
JSON stands for JavaScript Object Notation. Despite the name it isn't a program, it isn't compiled, and it has nothing to do with running JavaScript. A .json file is plain text — the same kind of content as a .txt file, just arranged in a structure that software can read reliably.
It's become the default way applications hand data to each other — request your data from a social network, export an app's settings, or call almost any modern web API, and what comes back is JSON. That's why you keep meeting it.
Everything in a JSON file is built from six things:
| Looks like | Called | Means |
|---|---|---|
{ } | Object | A labelled group of things — like one record |
[ ] | Array | An ordered list — like a table's rows |
"text" | String | Words. Always in double quotes |
42 / 9.98 | Number | A number. Never in quotes |
true / false | Boolean | Yes or no. Lower case |
null | Null | Deliberately empty — not the same as zero or "" |
That's the whole language — no dates, no comments, no formulas. A date in JSON is just a string that looks like one.
H2: The fastest way to open a JSON file
This works on Windows, macOS, Linux, ChromeOS, iPhone and Android, because it only needs a browser:
- Open FileNaut's JSON Viewer.
- Click Upload and pick your
.jsonfile — or open the file in any text editor, select all, and paste it into the left-hand box. - The tree appears on the right, colour-coded by type: strings green, numbers amber,
true/falsepurple,nullgrey. - Click any
{or[row to collapse that branch, or use Collapse to close everything and reopen just the part you want. A collapsed branch tells you how many keys or items it holds. - Hover a row and click the copy icon to copy that value's path — e.g.
owner.email— ready to paste into code.
Nothing is uploaded — your browser reads and parses the file locally. That matters more than it sounds: data exports and API responses routinely contain email addresses, tokens and account IDs, and most "online JSON viewer" sites post your text to a server to render it.
If you'd rather have tidy indented text to paste back into your editor, use the JSON Formatter instead — formatter for cleaning up, viewer for exploring. The JSON formatter guide covers the difference.
H2: Opening a JSON file on your computer
Because JSON is plain text, every text editor already opens it. The trick is choosing one that doesn't mangle it.
| System | Do this | Watch out for |
|---|---|---|
| Windows | Right-click → Open with → Notepad | A one-line file shows as one endless line — no formatting |
| macOS | Right-click → Open With → TextEdit | Same — plus TextEdit may offer to save as RTF, which corrupts it |
| Any browser | Drag the file onto an empty tab | Firefox renders a tree; Chrome shows raw text unless you add an extension |
| Code editor | VS Code, Notepad++, Sublime — then Format Document | Best desktop option; struggles on very large files |
| Excel | Don't — convert first | Excel mangles JSON. Use JSON to CSV instead |
| Phone / tablet | Open the browser viewer above | iOS and Android ship no built-in JSON reader |
If you're comfortable in a terminal, two commands pretty-print a file in place. Both are verified output, not approximations:
# Built into macOS and Linux, no install needed
python3 -m json.tool data.json
# If you have jq installed — also lets you pull out one field
jq . data.json
jq 'keys' data.json
python3 -m json.tool doubles as a validity check — it prints the file if the JSON is valid, an error if not.
H2: Why double-clicking opens the wrong app
Nothing on your computer "owns" the .json extension by default, so whichever program most recently claimed text files gets it — often a browser, sometimes an app you installed years ago. To fix it permanently:
- Windows: right-click → Open with → Choose another app → pick your editor → tick Always use this app.
- macOS: right-click → Get Info → under Open with choose your editor → click Change All….
One warning worth repeating: if the file opens in Word or TextEdit's rich-text mode, do not save from there. Those apps substitute curly quotes for straight ", which makes the file invalid while looking identical.
H2: How to read what you're looking at
Once the tree is open, reading it is mostly recognising two shapes.
An object is one thing with labelled parts:
{
"name": "Ada",
"active": true,
"score": 91.5
}
An array of objects is a list of those things — the JSON equivalent of a spreadsheet, and by far the most common shape in a data export:
[
{ "name": "Ada", "score": 91.5 },
{ "name": "Alan", "score": 88.0 }
]
When you see that shape, the outer [ ] is your rows and the keys inside are your columns — which is exactly the file you can turn into a spreadsheet in one step with JSON to CSV.
Nesting is what makes real files hard to read — an object inside an object inside an array, five levels deep. That's the whole reason to use a tree: collapse everything, then open only the branch you need. A copied path like owner.roles[0] is that value's address, and a number in brackets means "item at that position", counting from zero.
H2: Opening a large JSON file
This is where most advice quietly fails. A "large" JSON file is not a 500 MB monster — problems start far earlier, and the reason is not the parsing.
Reading the file is almost free. Drawing every row of it on screen is not. Measured in Chrome on a modern laptop, using the same tree structure a viewer builds:
| File size | Rows in the tree | Time to parse | Time to draw it all |
|---|---|---|---|
| 0.15 MB | 15,000 | under 1 ms | ~0.1 s |
| 0.75 MB | 75,000 | 1 ms | ~0.5 s |
| 1.5 MB | 150,000 | 2 ms | ~1.1 s |
| 3.8 MB | 375,000 | 7 ms | ~3.0 s |
Parsing 3.8 MB takes seven milliseconds. Rendering it takes about three seconds — four hundred times longer. Every browser-based JSON viewer, including ours, has this shape, and slower machines will be worse.
So for anything past roughly a megabyte:
- Collapse first, expand second. If the viewer opens everything by default, hit Collapse immediately, then walk down only the branch you need.
- Don't use a plain text editor. Notepad and TextEdit become unusable on a large single-line JSON file. VS Code copes better but still slows.
- Extract before you view.
jq '.users[0]' big.jsonpulls out one record, so you inspect kilobytes instead of megabytes. - Convert instead of reading. For a long list of records, JSON to CSV gives you a spreadsheet — a far better tool for 50,000 rows than any tree.
Multi-gigabyte files — server logs, database dumps — need a streaming parser. No browser tab will open those, whatever a site promises.
H2: When the file won't open at all
If a viewer rejects your file, it will usually show the raw parser message. Those messages are precise once you know the translation. Every message below is the verbatim output of the JSON parser browsers actually use:
| Message | What's really wrong |
|---|---|
Expected double-quoted property name in JSON… | A trailing comma after the last item: {"a": 1,} |
Expected property name or '}' in JSON… | Single quotes or unquoted keys: {'a': 1} or {a: 1} |
Expected ',' or '}' after property value… | A missing closing brace — or a // comment, which JSON forbids |
Unexpected end of JSON input | The file is empty or truncated — a download that stopped early |
Unexpected non-whitespace character after JSON… | Two documents in one file, or one object per line (JSON Lines) |
Unexpected token 'N'… / 'u'… / 'T'… | NaN, undefined or Python's True — not valid JSON |
Unexpected token ''… | An invisible byte-order mark at the start, added by some Windows editors |
Two deserve a note. JSON Lines — one complete object per line, no wrapping brackets — is a real format used for logs and exports; it isn't broken, it just isn't a single JSON document. Wrap the lines in [ ] with commas between them and it becomes one. A byte-order mark is invisible in every editor, making it the most infuriating of the set: if a file looks perfect and still won't parse, re-save it as UTF-8 without BOM.
Use the position number in the message with the JSON Formatter, which flags syntax errors as you type. Comparing a file that works against one that doesn't? Text Compare shows the difference directly.
H2: Valid JSON that quietly changes your data
A file can open perfectly and still not mean what you think. These are the cases worth knowing before you trust what you read — each one verified, not assumed:
- Very large numbers lose accuracy.
{"id": 12345678901234567890}reads back as12345678901234567000. Beyond about 9 quadrillion, values can't be held exactly, so long IDs get silently rounded. This is why well-built APIs send big IDs as strings. - Duplicate keys silently win.
{"a": 1, "a": 2}is legal JSON and gives you2. The first value vanishes with no warning. - Leading zeros only survive in strings.
"07030"stays a ZIP code; unquoted07030isn't valid JSON at all, and a tool that "helpfully" converts it gives you7030. - Order is not guaranteed. Object keys have no meaningful order and some tools re-sort them on save. Arrays are ordered — that difference matters.
- Escapes are already decoded.
"café"displays ascafé, so the file on disk and the value on screen legitimately differ.
H2: Turning a JSON file into something you can work with
Often "open this JSON file" really means "get this data somewhere useful":
- Into a spreadsheet — JSON to CSV, then open the CSV. Works cleanly when the file is an array of flat objects.
- Back the other way — CSV to JSON, with the pitfalls covered in the CSV to JSON guide.
- Into a config file — YAML ↔ JSON; YAML vs JSON explains which to use.
- From an older system — XML ↔ JSON.
- Just tidier — JSON Formatter re-indents it for any editor.
H2: Tips
- Keep a copy before you edit. One missing brace makes the entire file unreadable — there's no partial recovery.
- Format first, read second. Most JSON arrives minified as one long line — indent it before trying to read it.
- Treat exports as sensitive. "Download my data" files hold addresses, message history and tokens — use a viewer that runs locally.
- Check the file really is JSON. On macOS or Linux,
file data.jsonprintsJSON datawhen it parses as JSON. - Note the shape before the contents. Is the top level
{or[? Object means one record; array means a list — that single character determines everything else.
H2: Frequently asked questions
What program opens a JSON file? ▼
Is it safe to open a JSON file? ▼
How do I open a JSON file on my iPhone or Android? ▼
How do I open a JSON file in Excel? ▼
Why does my JSON file open as one long line? ▼
How do I open a very large JSON file? ▼
jq, or convert to CSV. Multi-gigabyte files need a streaming parser and won't open in any browser tab.What's the difference between a JSON viewer and a JSON formatter? ▼
Can I edit a JSON file and save it? ▼
python3 -m json.tool yourfile.json.My file has one JSON object per line — why won't it open? ▼
.jsonl extension. Each line is valid on its own, but the file as a whole isn't one JSON document — which is why you get "Unexpected non-whitespace character after JSON". To open it as one file, wrap the lines in [ ] and add a comma at the end of every line but the last.What is a .json file used for? ▼
package.json, settings.json), web API responses, and "download your data" exports from services like Google or Instagram. All three are written for software to read — which is why a tree viewer helps when a human has to.Ready to try it?
Use the tool right now — free, no signup, no upload.