How to Open a JSON File
How to open a JSON file: any text editor such as Notepad works, since JSON is plain text. Open it in a free browser viewer to read it as a tree.
Have broken JSON right now? Fix it free in under 1 second — no signup.
Fix My JSON →A JSON file is plain text, so any text editor opens it, Notepad included. RFC 8259 defines JSON as a text format, and JSON exchanged between systems must be encoded as UTF-8. If the content sits on one long line, open it in a JSON viewer or paste it into a formatter to add indentation and make it readable.
Written by The JSON Medic.
What program opens a JSON file?
Any program that shows text. You do not need a special JSON program to read one:
- A text editor — Notepad, TextEdit, gedit and the like show the characters as they are.
- A code editor — VS Code and other code editors open .json files and colour the syntax.
- A web browser — tested on current versions: Firefox 158 opens a local .json file in its own JSON viewer, with a collapsible tree, a Raw Data tab and Expand All / Collapse All buttons. Chrome 155 shows the raw text with a Pretty-print checkbox at the top that indents it.
- An online viewer — the JSON file viewer on this site opens the file in your browser (nothing is uploaded) and shows it as a tree or as indented text.
Open a JSON file with Notepad
Notepad opens a .json file like any text file, because that is all it is. What you see depends on how the file was saved:
- If it was saved indented, you see one key per line and it is easy to read.
- If it was saved minified (all whitespace removed to make it smaller, which APIs and many tools do), you see one very long line. Nothing is wrong with the file; it only needs indenting.
Notepad does not check whether the JSON is valid and does not indent it for you. For that, use a viewer or a formatter.
Make a JSON file readable
Indent it. Whitespace between JSON tokens does not change the data (RFC 8259 allows it anywhere between tokens), so adding line breaks and spaces is safe.
Three ways on this site, all in the browser:
- JSON file viewer — click Open file or drop the file on the page. You get a collapsible tree, and a Text view indented with two spaces. Files up to 50 MB; in our test in desktop Chrome a 42 MB file opened as a tree in about 2 seconds.
- JSON formatter — paste the text (this page takes pasted text only, no file upload), choose 2 or 4 spaces, and click Beautify.
- JSON Studio — click Upload to load the file, then use the Format tab.
From the command line, two common tools indent a file. Both stop with an error if the JSON is invalid:
python3 -m json.tool data.json # 4-space indent
jq . data.json # 2-space indent
For example, on {"a":1,} Python 3.12 prints Expecting property name enclosed in double quotes: line 1 column 8 (char 7) and jq 1.7 prints jq: parse error: Expected another key-value pair at line 1, column 8.
Check that the file is valid JSON
If a program refuses the file, or the viewer shows an error instead of a tree, the text breaks JSON syntax. The JSON validator and the viewer both report the line and column of the first error. The usual causes:
| Problem | Example | Why it fails |
|---|---|---|
| Trailing comma | {"a": 1,} | RFC 8259 allows a comma only between members |
| Single quotes | {'a': 1} | Strings and keys must use double quotes |
| Comments | // note | The JSON grammar has no comments |
To fix them automatically, paste the text into the JSON repair tool; it lists every change it made. More messages, by language, are under JSON errors.
Can a JSON file be opened as a PDF?
No. JSON is text, not a PDF document, so open it as text. If you need a PDF copy, open the file in a text editor or a browser and print it with a PDF printer, if your system has one. Indent it first so the printout is readable.
Opening a JSON error file from a portal or an API
Some services, government tax portals among them, hand you an "error file" in JSON. Open it the same way: a text editor, a browser, or the JSON file viewer. The JSON standard only defines the syntax. What each field and error code means is defined by the service that produced the file, so look the codes up in that service's own documentation.
Other ways to open and inspect JSON
- Pull out one field with the JSONPath tester, for example
$..email. - Compare two versions with JSON diff.
- Convert the file to CSV, YAML or XML with the JSON converter, or see all conversions under Convert.
- Learn the format itself in Learn JSON.
FAQ
What program opens a JSON file?
Any text editor, such as Notepad, or a code editor or web browser. RFC 8259 defines JSON as a text format, so no special program is required to read it.
Can I open a JSON file with Notepad?
Yes. JSON is plain text, so Notepad shows its contents. If the file is minified, it appears on one line, and a viewer or formatter can add indentation.
How do I convert a JSON file to readable?
Open it in the JSON file viewer, or paste the contents into the JSON formatter, to indent it. Whitespace between tokens does not change the data under RFC 8259.
How do I open a JSON file in PDF?
A JSON file is not a PDF and opens as text. Open it in a text editor or browser and print it to a PDF printer if you need a PDF copy.
Which browser shows JSON files best?
In our tests, Firefox 158 opens a local .json file in a built-in tree viewer, and Chrome 155 shows the raw text with a Pretty-print checkbox. Either works; the JSON file viewer on this site gives the same tree in any browser and also reports errors.
Still dealing with broken JSON?
Paste it in and get it fixed in under 1 second — free, no signup, no install. Works with ChatGPT, Claude, n8n, and any AI output.
Fix My JSON Free →The JSON Medic newsletter
One JSON error and its fix, weekly, plus new guides and tools. Free.
We send a confirmation link first. Unsubscribe with one click in any mail. See the privacy policy.
Related Articles