Open a JSON file without installing anything
A .json file is plain text, so any text editor will show it, but what you usually get is one very long line of brackets and quotes. To open a JSON file here, choose it with Open, drag it onto the editor, or paste its contents. The page then lays the data out in three different ways, and none of them requires knowing how to program.
The reader shares its interface with the JSON Viewer. This page is written for people who have been handed a file, such as an account data export, an app backup or a settings file, and simply want to read it. If you are a developer exploring API responses, the JSON Viewer page covers that workflow.
Three ways to get the file in
- Open button. Choose a file ending in
.jsonor.txtfrom your computer or phone. - Drag and drop. Drop the file anywhere on the left-hand editor.
- Paste. If the JSON sits in an email, a chat or a web page, copy the text and paste it into the editor.
Your browser reads the file as UTF-8 text, the encoding JSON files are expected to use, and nothing is sent to our server. The text stays editable on the left, so you can correct a value and save a copy with Download.
Choosing a view: tree, table or graph
| View | Best for | What you see |
|---|---|---|
| Tree | Any file | An outline with one row per field. Sections that contain other fields have a triangle and a count such as "3 keys" or "12 items". The first two levels open automatically. |
| Table | Lists of similar records, such as contacts, orders or messages | Rows and columns, like a spreadsheet. Click a column heading to sort by it; Copy CSV copies the table for pasting into a spreadsheet. |
| Graph | Seeing how sections connect | A box for each section, joined by lines, with up to eight simple fields shown inside each box. |
When a file contains several lists, a menu above the table lets you pick which one to show. A file with no such list, just one group of fields, appears as a two-column table of names and values.
Reading large or deeply nested files
Big exports are where a reader earns its keep, and a few limits keep the page responsive:
- A section's contents are built only when you open it. A section with more than 1,000 entries shows the first 1,000 plus a line saying how many more there are; the filter box reaches the rest.
- Expand all opens up to the first 5,000 sections, and Collapse all folds everything back to the top level.
- The Table view lists the first 500 rows of a list and the Graph view draws up to 150 boxes. Copy CSV still includes every row.
- With very large text, the page waits slightly longer after each edit before reading it again, so typing stays smooth.
For deeply nested files, the line above the views shows the file size, the deepest level, the number of keys and the total number of nodes (every section and value), which tells you how much is folded away before you start clicking.
Finding one value in a big file
Type a word or number into Filter keys & values and the tree narrows to matching fields and the sections that contain them, with each match highlighted. Click any field name and the bar above the tree shows where it lives, for example $.employees[1].name in the sample, together with its type and value. Copy value copies just that piece, and Copy path copies the location so you can tell someone else exactly where to look.
Understanding what you are reading
- Text appears in quotes; numbers,
trueandfalseappear without them. nullmeans the field exists but was deliberately left empty.- Entries in a list are numbered from 0, so the third item is number 2.
- Dates are usually written like
2024-05-02T09:14:00Z, where the final Z means the time is in UTC rather than your local time.
When the file will not open
- A message under the editor names the problem with its line and column. Go to error jumps to that spot.
- A file cut off during download is missing its closing brackets. Try Repair can often close them so you can read what arrived.
- A file with one record per line, often named
.jsonlor.ndjson, is not a single JSON document. Combine the lines first with JSONL to JSON. - Accented letters that look garbled usually mean the file was saved in another encoding; re-save it as UTF-8 in a text editor and open it again.
- If you need the records in a spreadsheet file rather than on screen, use JSON to Excel or JSON to CSV.
Open a JSON file in Python
Open the file in text mode and pass the file object to json.load(); the result is ordinary dictionaries and lists. Two mix-ups cause most errors. json.loads(), with an s, expects a string, so handing it a file object raises TypeError and handing it a file name raises JSONDecodeError. And without encoding="utf-8" Python uses the default encoding of the system locale, which is not always UTF-8. A file with one object per line is JSON Lines rather than JSON and stops with Extra data; read it line by line or convert it with JSONL to JSON.
import json
from pathlib import Path
# Create a small sample file so the example runs as shown
Path("data.json").write_text(
'{"company": "Northwind Labs", "employees": [{"id": 101, "name": "Zoë"}]}',
encoding="utf-8",
)
with open("data.json", encoding="utf-8") as f:
data = json.load(f) # load() reads a file, loads() reads a str
print(type(data).__name__) # dict
print(data["employees"][0]["name"]) # Zoë
print(json.dumps(data, indent=2, ensure_ascii=False))
To look inside a file before writing any code, drop it on this page and browse the tree.