TextBench Lab

Developer

How to Open a JSON File on Windows, Mac or Browser

You can open a JSON file with any text editor, because JSON is plain text. On Windows, right-click the file, choose Open with and pick Notepad; on a Mac, open it with TextEdit; on any system, a code editor or the Firefox browser works too. To make it easy to read, paste the contents into a JSON formatter, and to open it as a table in Excel, import it with Power Query or convert it to CSV first.

Below are the quickest ways to open a JSON file, how to make a long one-line file readable, and what to do when it will not open or shows strange characters.

What is a JSON file?

A JSON file stores data as text: names and values in curly braces, lists in square brackets. It usually ends in .json. The JSON standard, RFC 8259, says JSON exchanged between systems outside a closed ecosystem must use the UTF-8 text encoding. It gives JSON the media type application/json and the file extension .json.

A small file looks like this:

{
  "name": "Sample order",
  "items": ["paper", "ink"],
  "paid": true
}

Because it is text, nothing special is needed to open it. You only need the right tool for what you want to do with it.

Which program should you use to open a JSON file?

You want toUseNotes
Just look at itA text editor (Notepad, TextEdit)Always available; no colors or folding
Read a large file comfortablyA code editorSyntax colors, folding, search
Browse it like a treeFirefoxBuilt-in JSON viewer with collapsible sections
Pretty-print it from a terminalPythonOne command, no install if Python is present
Make it readable or check itOur JSON formatterIndents it and reports errors with line and column
Open it in Excel or Google SheetsOur JSON to CSV converterTurns the data into rows and columns

On a Mac, if TextEdit shows formatting controls, switch the document to plain text so nothing is changed when you save.

How do you open a JSON file in a browser?

Firefox has a built-in JSON viewer. Drag the file into a Firefox window, or press Ctrl + O (⌘ + O on a Mac) and choose the file. According to the Firefox documentation, the viewer parses and highlights the JSON, shows arrays and objects collapsed until you expand them with the "+" icons, offers a search box to filter the data, and can show the raw text or pretty-print it.

That is handy for exploring a file you did not write, such as an export from an app or a response saved from an API. You can read the file this way without changing it.

How do you make a JSON file readable?

Many JSON files are saved on one long line, with no spaces, because that makes them smaller. To read one:

  1. Open the file in a text editor and copy everything (Ctrl + A, then Ctrl + C; on a Mac, ⌘ + A, then ⌘ + C).
  2. Paste it into our JSON formatter.
  3. Click Format. The data is spread over lines and indented, one item per line.
  4. Copy the result back into your editor if you want to save the readable version.

Prefer a terminal? Python can do the same job.

The Python documentation describes python -m json.tool as a way to validate and pretty-print JSON. We ran it on a one-line version of the sample file above (Python 3.13):

python -m json.tool order.json
{
    "name": "Sample order",
    "items": [
        "paper",
        "ink"
    ],
    "paid": true
}

If the file is invalid, the command prints the error and the position instead.

The formatter works in your browser, accepts up to 500,000 characters, and never runs your data as code. If the file is invalid, it tells you the line and column of the first problem. The difference between formatting and minifying is explained in format or minify JSON.

How do you open a JSON file in Excel?

Excel can import JSON itself with Power Query. According to Microsoft Support, you select Data > Get Data > From File > From JSON, locate the file and select Open. The same Microsoft page on importing data with Power Query lists Excel for Microsoft 365, Excel 2024, 2021, 2019 and 2016 as supported. Excel works with tables and JSON is often nested, so the Power Query editor may ask you to expand records into columns. If you prefer one step, convert the file to CSV first:

  1. Open the JSON to CSV converter.
  2. Paste the JSON, or choose the .json file (up to 2 MB). It is read in your browser and not uploaded.
  3. Nested data becomes columns, for example customer.address.city.
  4. Download the CSV and open it in Excel or Google Sheets. If accented letters look wrong in Excel, download again with Add a BOM to the download (Excel) ticked.

What if the JSON file will not open or looks wrong?

  • Windows asks which app to use. Choose Notepad, and tick the option to always use it for .json files if you want.
  • Double-clicking starts another program. Some apps register .json for themselves. Use Open with instead of double-clicking.
  • The file shows strange characters. It may not be UTF-8, or it may not be JSON at all. Open it in a code editor and check the encoding.
  • A tool says the JSON is invalid. The file is damaged or was edited by hand. What an unexpected token in JSON means covers the common error messages and fixes.
  • You are not sure whether to format or validate. See JSON formatter vs JSON validator.

Treat a JSON file as data, not as a program. Opening it in a text editor or a browser only displays its text.

JSON files: quick answers

Can I open a JSON file without installing anything?

Yes. Notepad on Windows and TextEdit on a Mac can open it, because JSON is plain text.

How do I edit a JSON file?

Open it in a text editor, make the change, and check it with a JSON formatter before saving.

Can Excel open a JSON file?

Yes. Recent versions can import it with Power Query (Data > Get Data > From File > From JSON), or you can convert it to CSV first and open the CSV in Excel. Our JSON to CSV converter does that in your browser.

Why is my JSON file all on one line?

It was saved minified to save space. A formatter spreads it over lines for reading.

Sources

Checked on 2026-11-07: