How to Open a JSON File on Windows, Mac or Phone?

Someone sent you a file that ends in .json. Or you downloaded your data from an app and got a folder full of them. When you double-click one, your computer asks which app to use. Or it shows a big block of text that is hard to read.

This guide shows you simple ways to open a JSON file and actually read it, on any device.

Quick answer: A JSON file is plain text, so you can open it with any text editor, such as Notepad on Windows or TextEdit on Mac. To read it easily, use a JSON viewer. It shows the data as a tree that you can open and close.

What is a JSON file?

JSON is a text format for storing data. A JSON file holds names and values, like "city": "Paris", grouped with curly braces and square brackets. It is not a program. It is just text. If you are new to JSON, start with What Is JSON?

How to open a JSON file online (any device)

The easiest way to read JSON is with a JSON viewer. It turns the text into a tree, so you can see the structure quickly.

  1. Open the JSON Viewer.
  2. Upload the file, drag it onto the viewer, or paste the text.
  3. Switch to the Tree tab. Click any object or array to open or close it.

Each part of the tree shows how many keys or items it holds. Text, numbers, true/false values and null each get their own colour. This works on Windows, Mac, Linux and phones, because it all runs in your web browser.

If the file is a list of records

Many JSON files hold a list of similar items, such as orders or contacts. These are easier to read as a table. Paste the file into the JSON Table Viewer to see one row per item and one column per field. You can sort by any column, and type in the filter box to show only matching rows.

How to open a JSON file in your web browser

You can drag a JSON file from your desktop into a browser window. Firefox has a built-in JSON viewer. It shows the data as a tree, and it has a tab for the raw text. Other browsers may only show the raw text. That is fine for small files, but hard to read for long ones.

How to open a JSON file on Windows

  1. Right-click the file.
  2. Choose Open with, then pick Notepad.

If Notepad is not in the list, click Choose another app and find it there. Do you want all JSON files to open with the same app? Then choose the option to always use that app.

How to open a JSON file on Mac

  1. Control-click (or right-click) the file.
  2. Choose Open With, then TextEdit.

To change the default app, select the file and choose File → Get Info. Pick an app under “Open with”, then click Change All.

How to open a JSON file in VS Code

If you plan to edit JSON, a code editor is better than Notepad. Visual Studio Code (VS Code) is a free code editor for Windows, Mac and Linux. It understands JSON without any add-ons:

  • It colours keys and values so they are easy to tell apart.
  • It underlines errors, such as a missing comma.
  • You can fold (hide) sections you don’t need to see.
  • It can tidy the layout with Format Document. The shortcut is Shift + Alt + F on Windows, Shift + Option + F on Mac, or Ctrl + Shift + I on Linux.

Don’t open JSON in Word or other word processors. When you edit, they can change straight quotes into curly “smart” quotes. That breaks the JSON. See common JSON errors for more mistakes like this.

How to open a JSON file in Excel

Excel does not open JSON with a simple double-click. There are two ways to get JSON data into a spreadsheet.

Option 1: Convert it to an Excel file

  1. Open the JSON to Excel converter.
  2. Paste the JSON or upload the file, then check the preview.
  3. Click “Download .xlsx” and open the file in Excel, Google Sheets or Numbers.

Each object becomes a row, and each key becomes a column. Nested data (data inside other data), like address.city, can get its own column. Long ID numbers are saved as text, so Excel does not round them.

Option 2: Use Excel’s own import

Recent versions of Excel for Windows can import JSON with a feature called Power Query. Go to Data → Get Data → From File → From JSON and pick the file. Then use the editor that opens to turn the records into a table. Menu names can differ a little between Excel versions.

Both options work best when the JSON is a list of similar records. To learn what can go wrong with nested data, read how to convert JSON to CSV without losing data.

How to open a JSON file on iPhone or Android

Phones don’t usually come with an app for JSON. The simplest way is to use your phone’s web browser:

  1. Save the JSON file to your phone, for example in the Files app or your Downloads folder.
  2. Open the JSON Viewer in your browser.
  3. Upload the file and switch to the Tree tab.

If the JSON came in a message or email, you can also copy the text and paste it into the viewer.

What if the JSON file is very large?

Text editors can slow down or freeze on very big files. The JSON Viewer only draws the parts you open. It also loads big arrays in small parts. So large files stay easy to use. For more help, see our tips for working with large JSON files.

Common questions

What program opens a JSON file?

Any text editor can open a JSON file, including Notepad, TextEdit and VS Code. A JSON viewer is better for reading it, because it shows the structure clearly.

Why does my JSON file show up as one long line?

JSON is often saved without spaces or line breaks to keep it small. This is called minified JSON. A JSON formatter adds the line breaks back. Our guide on how to format JSON shows you how.

Can I convert a JSON file to Excel?

Yes, if the file holds a list of records. A JSON to Excel converter turns it into an .xlsx file. Each record gets its own row.

Is it safe to open a JSON file?

A JSON file is just text. Opening it in a text editor or a viewer does not run anything. Still, only trust the data inside if you trust where the file came from.