Developer10 min readUpdated 2026-08-14

How to Open a JSON File

Tools mentioned in this guide

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 likeCalledMeans
{ }ObjectA labelled group of things — like one record
[ ]ArrayAn ordered list — like a table's rows
"text"StringWords. Always in double quotes
42 / 9.98NumberA number. Never in quotes
true / falseBooleanYes or no. Lower case
nullNullDeliberately 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:

  1. Open FileNaut's JSON Viewer.
  2. Click Upload and pick your .json file — or open the file in any text editor, select all, and paste it into the left-hand box.
  3. The tree appears on the right, colour-coded by type: strings green, numbers amber, true/false purple, null grey.
  4. 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.
  5. 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.

SystemDo thisWatch out for
WindowsRight-click → Open withNotepadA one-line file shows as one endless line — no formatting
macOSRight-click → Open WithTextEditSame — plus TextEdit may offer to save as RTF, which corrupts it
Any browserDrag the file onto an empty tabFirefox renders a tree; Chrome shows raw text unless you add an extension
Code editorVS Code, Notepad++, Sublime — then Format DocumentBest desktop option; struggles on very large files
ExcelDon't — convert firstExcel mangles JSON. Use JSON to CSV instead
Phone / tabletOpen the browser viewer aboveiOS 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 withChoose 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 sizeRows in the treeTime to parseTime to draw it all
0.15 MB15,000under 1 ms~0.1 s
0.75 MB75,0001 ms~0.5 s
1.5 MB150,0002 ms~1.1 s
3.8 MB375,0007 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.json pulls 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:

MessageWhat'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 inputThe 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 as 12345678901234567000. 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 you 2. The first value vanishes with no warning.
  • Leading zeros only survive in strings. "07030" stays a ZIP code; unquoted 07030 isn't valid JSON at all, and a tool that "helpfully" converts it gives you 7030.
  • 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 as café, 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":

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.json prints JSON data when 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?
Any text editor — Notepad, TextEdit, VS Code — because JSON is plain text. But an editor only shows raw characters. To read the data, use a tree viewer such as FileNaut's JSON Viewer, which collapses and expands the structure. Nothing to install.
Is it safe to open a JSON file?
Opening one is safe — JSON is data, not code, and can't execute anything. The risk runs the other way: the contents are often sensitive, since data exports carry email addresses, tokens and account IDs. Avoid sites that upload your text to a server. FileNaut's viewer parses the file in your browser.
How do I open a JSON file on my iPhone or Android?
Neither iOS nor Android ships a built-in JSON reader, so the reliable route is a browser: open the JSON Viewer, tap Upload, and pick the file from Files or your downloads folder. That avoids installing an app for a one-off file, and works the same on both platforms.
How do I open a JSON file in Excel?
Convert it with JSON to CSV first, then open the CSV. Excel's own Power Query import works but takes more steps and struggles with nested data. Either way, Excel reformats anything resembling a number or date — ZIP codes and long IDs get corrupted. Format those columns as text first.
Why does my JSON file open as one long line?
Because it was minified — the line breaks and indentation were stripped to save space, which is standard for anything sent over a network. The data is intact; only the layout is gone. Paste it into the JSON Formatter to restore indentation, or into the JSON Viewer to skip straight to a readable tree.
How do I open a very large JSON file?
Past roughly a megabyte, collapse the tree before expanding — the cost is drawing rows, not reading the file. A measured 3.8 MB file parses in ~7 ms but takes ~3 seconds to render fully expanded. Beyond that, extract what you need with 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?
A formatter gives you back text — clean, indented JSON you can copy into your code. A viewer gives you an interactive tree you expand, collapse and search, which is much faster for understanding a big or deeply nested file. Use the formatter when you need to hand the JSON to something else, the viewer when you need to understand it.
Can I edit a JSON file and save it?
Yes — any plain-text editor can change it. Two rules: never save from a rich-text editor like Word, which substitutes curly quotes and breaks the file invisibly; and always validate afterwards. Paste the result into the JSON Formatter, or run python3 -m json.tool yourfile.json.
My file has one JSON object per line — why won't it open?
That's JSON Lines (also called NDJSON), a real format used for logs and large exports, sometimes with a .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?
Moving structured data between programs. You'll meet three kinds most: app settings (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.