PDFGami Logo
v2.25.0
Free · Secure · Browser-Only

How to Open a JSON File — and Actually Understand What Is in It

By AIC Innovation·Published ·9 min read

You asked an AI coding assistant to fetch some data, call an API or export your settings, and it handed you a file ending in .json or .jsonl. You open it and get a wall of brackets, quotes and commas. Nothing is wrong with you, and usually nothing is wrong with the file: JSON is written for programs to read first and people second. This guide explains what is actually inside one, how to read it as the table it usually is, and how to open it in PDFGami's JSON viewer without the file leaving your computer. No programming knowledge is assumed.

Open the JSON Viewer

What a JSON file actually is

JSON stands for JavaScript Object Notation. Despite the name, it is not a program and it does nothing when you open it. It is plain text written in a strict, standard layout for storing data, and nearly every web service uses that layout to send data back and forth. That is why so much of what an AI assistant fetches for you — an API response, a batch of search results, the settings of an app — arrives as JSON.

The whole format is built from six kinds of value. Programmers have their own names for them; the plain meaning is what matters.

  • Text(programmers say “string”): anything inside double quotes, such as "Grace".
  • Number: 42 or 3.5, written without quotes.
  • True/false(a “boolean”): the bare words true and false.
  • Empty: the word null, meaning “deliberately no value here”. It is not zero and not blank text.
  • Record(programmers say “object”): a set of named values inside curly braces. Each name-and-value pair, such as "name": "Grace", is called a field. Think of a form that has been filled in.
  • List(programmers say “array”): values inside square brackets, separated by commas, kept in order.

The power of the format, and all of the confusion, comes from nesting. A field in a record can hold a list, a list can hold records, and those records can hold lists of their own. A file that looks impenetrable is very often just a list of records, some of which contain a smaller list.

Read it like a table

Here is the most common shape you will be handed, a list of records, small enough to read by eye:

[
  { "id": 1, "name": "Grace", "email": "grace@example.com", "plan": "pro" },
  { "id": 2, "name": "Linus", "email": "linus@example.com" },
  { "id": 3, "name": "Margaret", "email": "margaret@example.com", "plan": "free" }
]

Read it as you would a spreadsheet. The square brackets wrap the whole table. Each pair of curly braces is one row — one record. Each name before a colon — id, name, email, plan — is a column heading, and the value after the colon is what sits in that cell. Laid out as a table, the same data looks like this:

idnameemailplan
1Gracegrace@example.compro
2Linuslinus@example.com(missing)
3Margaretmargaret@example.comfree

Two things are worth noticing. First, Linus's record has no planfield at all. JSON does not require every row to have the same columns, which is why real files so often have gaps — and why a column that is “missing” is different from one that is present and set to null. Second, order matters in a list (Linus is the second record) but not among the fields inside a record.

Paste exactly this into the viewer and the What is in this filebox reads it back to you in those terms: a list of 3 records, “think of it as a table: each record is a row”. It says every record has three fields — id, name and email — that some records also have plan, which is missing from the rest, and that the file holds 8 text values and 3 numbers. That is the table above, described in plain words, before you have expanded anything. On a real export with 4,000 records and 30 fields, that one paragraph is the fastest way to learn what you are dealing with.

Open a JSON file in four steps

  1. 1
    Open the viewer. Go to pdfgami.com/json-viewer. Nothing to install and no account.
  2. 2
    Drop the file or paste. The viewer accepts .json, .jsonl, .ndjson, .geojson, .har, .map, .webmanifest and .txt files. Anything else is turned away with a message rather than opened as nonsense. If the JSON is sitting in a chat or a terminal window, copy it and paste it into the box instead.
  3. 3
    Read the summary. The What is in this file box says whether you have a list of records, a single record, or a list of plain values; which fields every record has and which only some have; how many text, number, true/false and empty (null) values there are; and how many levels deep the nesting goes.
  4. 4
    Explore, or tidy it up. Browse the tree, or switch to Formatted to get the whole file laid out neatly as text.

The Formatted view is for when you need the file itself in a readable state — to paste back to your assistant, to drop into a config, or to keep. Choose 2-space, 4-space or tab indentation. Tick Sort keys A–Zto put every record's fields in alphabetical order, which makes two similar files much easier to compare by eye. Then use Copy formatted, Copy minified (the same data squeezed onto one line, which is smallest) or Download .json. A file that was saved with an invisible byte-order mark at the start — some Windows programs add one, and it makes many readers fail on the very first character — opens normally; the mark is ignored.

Finding one value in a big file

The tree shows the document as an outline you can fold. Every list tells you how many items it holds, as in [ 120 items ], and every record how many fields it has, as in { 6 fields }, so you know how big a branch is before you open it. Click a line with an arrow to open or close it. The first two levels start open; deeper branches stay closed so a large file does not flood the screen. A long list shows its first 100 entries, with a button to show the next 100.

When you are hunting for something specific, type at least two characters into the search box. Every field name and every value containing that text is highlighted, the branches that contain a match open themselves, and a count tells you how many matches there are. Searching for @gmail in a customer export, for example, highlights every Gmail address and opens whichever branches they sit in, however deep.

Click any line and a bar under the tree shows its path: the address a program would use to reach that value, such as users[3].email. Read it left to right — the users field, then item number 3 in that list, then its email field. One trap: counting starts at zero, so [3] is the fourth user, not the third. A Copy pathbutton sits next to it. This is more useful than it looks. Telling an AI assistant “use users[3].email” is unambiguous in a way that “the email of that user near the bottom” never is.

JSON Lines: the file that looks broken but is not

A file ending in .jsonl or .ndjson is JSON Lines: one complete record per line, with no square brackets around the whole thing and no commas between lines. It is the usual format for logs, bulk exports and AI datasets — fine-tuning examples and batch results among them — because a program can add or read one line at a time without loading the entire file.

The catch is that, taken as a whole, a JSON Lines file is not valid JSON. A strict reader treats it as one document, gets to the end of the first line, finds more text where it expected the file to end, and reports an error. So a perfectly good dataset is often declared broken. The JSON viewer tries the file as ordinary JSON first. If that fails but every non-empty line is valid on its own, it reads the file as JSON Lines, shows all the lines together as one list you can browse like any other, and adds a note to the summary saying that is what it did. It needs at least two lines to recognise the format — a one-line file is simply ordinary JSON and opens as such anyway.

If a line is damaged, the file cannot be shown as a list, but the viewer still recognises what it is. When there are at least three lines and most of them are valid on their own, it reports a JSON Lines file with one broken line, names that line, and adds the likely cause when it is a common one, such as a comma after the last item. Only in a very short file, or one where most lines fail, does it fall back to the error for the whole file read as a single document — which points at the start of the second line rather than the damaged one. If that happens with a .jsonl file, paste a few lines at a time to narrow down the culprit.

When the file really is broken

JSON is unforgiving, and both hand edits and AI-generated output break it regularly. When the text is not valid, the viewer says so and, where it can, tells you where: the problem is on line 12, column 5. Underneath it prints the browser's own error message and the offending line, with a ^marker under the column. That location is recovered from the browser's error message, and browsers word that message differently; if yours does not include a position, you still get the message, just without the marker.

Nearly every broken file comes down to one of four mistakes, and the viewer lists them under the error:

  • A missing comma between two items: { "a": 1 "b": 2 }.
  • A trailing comma after the last item: [1, 2, 3,]. Many programming languages allow this; JSON does not.
  • Single quotes instead of double: { 'name': 'Grace' }. Only double quotes count.
  • Comments, written with // or /* */. Some config files use a looser variant of JSON that permits them; standard JSON does not, and the viewer follows the standard.

The marker shows where the reader gave up, which is often just after the real mistake: a missing comma is noticed at the start of the next item, not at the end of the previous one. Look at the marked spot and the few characters before it. For files under about 2 MB the input box is editable, and the summary and tree update as you type, so you can fix the text and see immediately whether it now reads. Or give the line and column to your assistant and ask it to repair that spot.

Before you paste an API response anywhere

The files this guide is about carry secrets more often than people expect. An API response can echo back an access token; a settings export can contain an API key or a database password; a customer list is personal data by definition; and a .harfile — a recording of a browser's network traffic — routinely includes the cookies that keep you signed in. Pasting any of that into an arbitrary website means sending it to a server you know nothing about. If what you pasted held a live key, the safe assumption is that the key is now exposed.

The viewer does all of its work in JavaScript inside your own browser tab. The file is read, parsed, summarised and formatted on your machine, and nothing is uploaded. You do not have to take that on trust, and you should not take it on trust from any site. Open your browser's developer tools (F12, or Cmd+Option+I on a Mac), switch to the Network tab, then paste or drop your file. A site that uploads will show a request carrying your data; here the tab stays quiet. The same check works everywhere, and this five-minute walkthrough covers it step by step.

If a key has already ended up somewhere it should not have, do not rely on deleting the paste. Issue a new key in the service's dashboard and revoke the old one.

The other file your assistant will hand you

JSON is for data. Explanations, plans and READMEs usually come as Markdown instead — .md files full of pound signs and asterisks. The Markdown viewer renders those as a formatted page, tables and checklists included, and can save the result as a PDF to share. Both live in the file viewers section, and both open the file in your browser without uploading it.

Frequently asked questions

What is a JSON file?

A plain-text file that stores data in a strict, standard layout. It is not a program and does nothing when opened. It is built from records (named fields inside curly braces), lists (values inside square brackets), and simple values: text in double quotes, numbers, true or false, and null for "empty". Almost every web service sends data this way, which is why an AI assistant that calls an API or exports settings so often hands you one.

How do I open a JSON file on Windows or Mac?

Because it is plain text, any text editor will open it — Notepad on Windows, TextEdit on a Mac — but you will see the raw brackets and quotes, often squashed onto one line. To actually read it, drop it into a JSON viewer. PDFGami's viewer runs in the browser on either system, lays the file out as a collapsible tree, and describes what is in it in plain English, without uploading it.

What is a JSONL file, and why does my JSON tool say it is broken?

JSONL (JSON Lines, also saved as .ndjson) holds one complete record per line, with no brackets around the whole file and no commas between lines. It is common for logs, exports and AI datasets. A strict JSON reader treats the file as one document, reaches the end of the first line, and reports an error. PDFGami's viewer checks for this: if every non-empty line is valid on its own, it reads the file as JSON Lines, shows the lines together as one list, and says so.

Why does the viewer say my JSON is invalid?

Something in the text breaks JSON's rules. The four usual causes are a missing comma between two items, a comma after the last item, text in single quotes instead of double quotes, and comments. The viewer reports the line and column where the browser gave up, when the browser's error message includes a position, and shows that line with a ^ marker under the spot. The actual mistake is usually at that spot or just before it.

Can I edit the JSON in the viewer?

You can edit the text in the input box, and the summary and tree update as you type, which makes it a quick way to fix a syntax error and check the fix. The tree itself is read-only: you cannot change a value by clicking on it. Files larger than about 2 MB are not placed in the text box at all, because editing that much text in a browser box is painfully slow; they are still read in full and shown in the tree.

Can I convert a JSON file to Excel or CSV here?

No. The viewer reads, explains, formats and downloads JSON; it does not convert it into other formats. What it can do is tell you whether the file is a list of records with the same fields — the shape that converts cleanly into a spreadsheet — and which fields only some records have, which is exactly what you need to know before asking your assistant or a spreadsheet program to do the conversion.

Does it support comments or JSONC?

No. Standard JSON does not allow comments, and the viewer follows the standard, so a // or /* */ comment is reported as an error on the line where it appears. Some configuration files use a looser variant that permits comments; to read one here, delete the comment lines first.

Is it safe to paste an API response into an online JSON viewer?

It depends entirely on whether the site uploads what you paste. API responses and config exports often contain keys, tokens and personal data. PDFGami's viewer parses everything in JavaScript inside your own tab and sends nothing to a server. You can confirm that, on this site or any other, by opening your browser's developer tools, switching to the Network tab, and watching what happens when you paste.

How large a JSON file can it open?

There is no fixed limit; the practical ceiling is your device's memory, because the whole file is read into the tab. The tree stays responsive on big files because it only draws what is open, and long lists show 100 entries at a time with a button for the next 100. Files over about 2 MB skip the editable text box but are otherwise read and displayed in full.

Open your JSON file now

Drop the file or paste the text, read what is in it in plain English, and find the value you need. Free, no account, and the file never leaves your device.

Open the JSON Viewer