Skip to content
Back to Blog
By JSONConvert Team··5 min read

What Is a JSON File and How Do You Open It?

A JSON file is a plain text file that stores data as named values, lists and nested groups. The extension is .json and the format is defined in RFC 8259. Because it is text, any text editor opens it: Notepad on Windows, TextEdit on a Mac. To read it comfortably, open it in Firefox, which has a built-in JSON viewer, or paste it into a JSON viewer to get a tree you can expand and collapse.

What a JSON file looks like

That is close to the whole format. A JSON value is one of six things: a string in double quotes, a number, true or false, null, an array in square brackets, or an object in curly braces made of "key": value pairs. Objects and arrays can nest inside each other to any depth.

A few things JSON does not have. There are no comments, no date type (dates are written as strings such as "2026-10-28"), and no trailing comma after the last item. Those three cause most "invalid JSON" errors when people edit a file by hand.

What JSON files are used for

  • App and tool settings. JavaScript projects keep their dependencies in package.json, and many apps store preferences in a .json file.
  • Data from web services. Most web APIs send their responses as JSON, so saved API responses are .json files.
  • Data exports. Many services export your account data as JSON because it keeps nesting that a spreadsheet would flatten.

How to open a JSON file

On Windows

Right-click the file, choose Open with, then Notepad. For syntax colours and formatting, use a code editor. In VS Code, Shift+Alt+F reformats a JSON file that arrived on one long line.

On a Mac

Right-click the file, choose Open With, then TextEdit. In VS Code the format shortcut is Shift+Option+F.

In a browser

Drag the file into a Firefox window. Firefox's JSON viewer parses the file, shows objects and arrays as a collapsible tree, and has a search box to filter it. It also has tabs to see the raw text and to pretty-print it. In other browsers, if the text shows up as one long line, copy it into the JSON formatter.

On a phone or tablet

Phones have no dedicated JSON app built in. The easiest route is to copy the text into the JSON viewer in your phone's browser. It runs in the browser, so the data is not uploaded.

How to make it readable

If the whole file is one long line, it was minified to save space. Paste it into the JSON formatter to put each value on its own line with indentation. For a deep file with hundreds of nested levels, the JSON viewer is easier, because you can collapse what you do not need. If the file is hundreds of megabytes and every app freezes, see how to open large JSON files.

How to turn it into a table or a PDF

  • Excel: Excel can import JSON through Power Query. The JSON to Excel guide walks through it, plus the CSV and Python routes.
  • CSV: the JSON to CSV converter turns a list of records into rows and columns that any spreadsheet opens.
  • PDF: PDF is a page layout, so there is no direct JSON to PDF conversion that keeps the data usable. Format the JSON first, or for a list of records turn it into a table with the JSON to HTML table converter. Open the result in your browser and use Print, then Save as PDF. A table prints far better than raw JSON.

How to check a JSON file is valid

If an app refuses a JSON file, paste it into the JSON validator. It shows the line and column of the first error. The usual causes are a trailing comma, single quotes instead of double quotes, or a missing closing bracket. The guide to JSON parse errors explains each message.

FAQ

Is a JSON file safe to open?

Yes. JSON is data, not a program, and the format has no way to run code. Opening it in a text editor, a browser or a viewer only displays text.

Can I delete a JSON file?

It depends on what made it. A JSON file inside an app or game folder is often that app's settings or saved data, and deleting it can reset or break the app. A JSON file you downloaded or exported yourself is safe to delete once you have what you need.

What program opens JSON files?

Any text editor. For reading, Firefox, VS Code or an online viewer. For a table, Excel through Power Query, or a CSV conversion.

What is the difference between a JSON file and a .txt file?

Both are plain text. A JSON file follows strict rules so programs can read it as structured data. If you rename a .json file to .txt, any editor opens it and the content is unchanged.

What does JSON stand for?

JavaScript Object Notation. The syntax came from JavaScript, but every common programming language reads and writes JSON.

Related Tools