How to Open a JSON File on Windows, Mac, and More

5 mins read

Updated on 2026-09-18 19:06:21 to Wiki

JSON files store structured data in a plain-text format, but they may not open in a way that is easy to read. Depending on your device and what you need to do with the file, you can use different tools to open it.

This guide explains how to open a JSON file on Windows, Mac, and other platforms, plus what to try if the file will not open or has been deleted.

how to open a json file

How to Open JSON Files

The best way to open a JSON file depends on whether you only need to view its contents, edit the data, or work with it in another application. The table below gives you a quick way to choose a method.

Method Best for Platform
Text editor Quick viewing or simple edits Windows, Mac, Linux
Code editor Viewing, formatting, and editing Windows, Mac, Linux
Web browser Quickly viewing JSON Most platforms
Online JSON viewer Formatting and validating JSON Any platform
Excel Viewing JSON data in a table Windows, Mac
Python Reading and processing JSON Windows, Mac, Linux
jq Viewing and processing JSON in a terminal Windows, Mac, Linux

1. Using a Text Editor

A basic text editor is enough if you only want to view a JSON file or make a simple change. Because JSON uses plain text, you do not need a specialized program just to open it.

How to Open .JSON Files on Windows Using Notepad

On Windows, Notepad provides a simple way to access a JSON file.

  • Find the .json file in File Explorer.

  • Right-click the file and select "Open with".

  • Choose "Notepad".

    open json files with notepad windows
  • View or edit the JSON content.

Notepad works well for small files and quick checks. However, it does not provide the formatting and validation features available in a code editor.

How to Open .JSON Files on Mac Using TextEdit

You can also use TextEdit to open a JSON file on macOS.

  • Find the .json file.

  • Select "File > Open With".

  • Choose "TextEdit" to open it.

    open json files with textedit mac

If you plan to edit JSON, use plain text rather than rich text. TextEdit provides a "Format > Make Plain Text" option when needed.

How to Open .JSON Files on Linux via Nano

On Linux, you can use a terminal-based text editor such as Nano:

nano filename.json

Nano lets you view and edit the file directly from the terminal. This approach is useful when you are already working with files from the command line.

2. Using a Code Editor

If a JSON file looks like a long block of text in a basic editor, a code editor can make it much easier to read. Visual Studio Code (VS Code) is a cross-platform option with built-in JSON support.

To open a JSON file in VS Code:

  • Open "Visual Studio Code".

  • Select "File > Open File".

    open a json file with vs code
  • Choose your .json file.

  • View or edit the file in the editor.

VS Code provides JSON syntax highlighting and validation. It also lets you format the entire JSON document through "Format Document", which is useful when the file appears as one long line.

For example, a compact JSON file may initially look like this:

{"name":"John","age":30,"city":"Seattle"}

Formatting it can make the same data easier to scan:

 "name": "John",
  "age": 30,
  "city": "Seattle"
}

VS Code also supports folding JSON objects and arrays, which can help when you work with larger files.

3. Using a Web Browser

A web browser can be a convenient option when you only need to open and view JSON and do not want to install another editor.

You can usually open the file by dragging it into a new browser tab or using your operating system's "Open with" option.

Chrome, Firefox, and Edge can display JSON content, although the exact presentation can vary between browsers and versions.

open a json file with web browser

A browser is most useful for:

  • Quickly checking a JSON file
  • Viewing data without editing it
  • Checking whether a file contains readable JSON content

However, if you need to make changes, format the data, or troubleshoot syntax errors, a code editor or JSON viewer is usually more suitable.

4. Using an Online JSON Viewer

An online JSON viewer or formatter can help when you want to quickly view, format, or validate JSON without installing software.

Tools such as JSONLint and JSON Editor Online can provide features such as:

  • JSON formatting
  • Syntax validation
  • Expandable nested data
  • Searching within JSON
  • Basic editing

This method can be convenient for a non-sensitive file. However, be careful with files that contain passwords, API keys, personal information, or other confidential content. Avoid uploading sensitive JSON files to an online service unless you understand how the service handles your data.

5. Using Excel

If your goal is to work with the data rather than read the raw JSON structure, Excel can import JSON through Power Query.

In supported versions of Excel, you can:

  • Open "Excel".

  • Go to "Data".

  • Select "Get Data > From File > From JSON".

    open a json file via excel
  • Locate your JSON file and select "Open".

  • Review the imported data.

  • Load the data into a worksheet or work with it in Power Query.

Excel can be useful when you want to sort, filter, or analyze structured JSON data in a table. However, not every JSON file will immediately look like a clean spreadsheet. Nested objects and lists may require additional transformations in Power Query.

6. Using Python

If you are a developer and need to read or process JSON programmatically, Python includes a built-in json module.

For example:

import json

with open("data.json") as f:
    data = json.load(f)

The json.load() function reads a JSON document from a file and deserializes it into a Python object.

7. Using Command-Line Tools

For users who prefer the terminal, "jq" is a command-line JSON processor that can display and work with JSON data.

A simple command is:

jq '.' data.json

The . tells jq to output the entire JSON document. This can also make compact JSON easier to read in the terminal.

Command-line tools are most useful when you need to process JSON as part of a development or file-management workflow. For occasional viewing, a graphical editor is usually simpler.

What to Do If a JSON File Won't Open

If a JSON file will not open, the problem may not be the application itself. The file could have the wrong extension, invalid JSON syntax, unusual encoding, or simply be too large for the program you are using.

  • Check the file extension. First, make sure the file actually ends with .json. On Windows, file extensions may be hidden in File Explorer, so check the full filename before changing anything. Do not simply rename another file to .json and expect it to become a valid JSON file.

  • Try another editor or viewer. If your usual application cannot open the file, try another editor or viewer. If one application displays the content while another does not, the issue may be related to the application rather than the file itself.

  • Check for JSON syntax errors. Common problems include missing commas, missing quotation marks, unmatched {} or [], and extra commas. A JSON validator can help identify malformed content.

  • Check the file encoding. If the file opens but contains strange or unreadable characters, encoding may be part of the problem. Try another editor or select a different plain-text encoding instead of assuming the JSON data is damaged.

  • Check whether the JSON file is too large. A very large JSON file may be difficult for a basic text editor or browser to handle. Try VS Code or jq to inspect it, and avoid opening the file in multiple applications at once.

How to Recover When Your JSON File Was Deleted or Lost

If you accidentally deleted the JSON file, lost it after formatting a drive, or can no longer access it, check the Recycle Bin, Trash, backups, and cloud storage first.

If no backup is available, 4DDiG Data Recovery can scan your storage for files lost through accidental deletion, formatting, system crashes, and other data-loss situations. It can recover more than just JSON files, including HTML, DB, TXT, CSV, XML and more.

4DDiG uses a graphical interface, so you do not need command-line knowledge to search for lost data. Easy to use for even beginners.

FREE DOWNLOAD

Secure Download

FREE DOWNLOAD

Secure Download

  • Install and launch 4DDiG. Select the drive or location where your deleted or lost JSON file was originally stored.

    launch 4ddig and select the location where the JSON file was stored
  • The scan will start automatically. You can filter the scan results by file type or search for .json to quickly locate your missing JSON files.

    filter scan results to find deleted JSON files
  • Preview the found JSON files to check their contents and confirm which files you want to recover. Select the needed files and click "Recover".

    preview recoverable JSON files before recovery
  • Save the recovered JSON files to a different storage location rather than the original drive to avoid overwriting other lost data.

    save recovered JSON files to a different location

FAQs

What program can open JSON files?

You can open JSON files with a basic text editor such as Notepad on Windows or TextEdit on Mac. VS Code is another option if you want syntax highlighting, formatting, and validation.

Can I open a JSON file without installing software?

Yes. You may be able to open a JSON file with an existing text editor or web browser. An online JSON viewer can also display and format the file without requiring a desktop application.

Can I open a JSON file in Chrome?

Yes. You can open or drag a JSON file into a Chrome tab to view its contents. A browser is mainly useful for viewing JSON, not for making complex edits.

Can I open a JSON file in Excel?

Yes. Supported versions of Excel can import JSON through "Data > Get Data > From File > From JSON". You can then use Power Query to work with the imported data.

Conclusion

Learning how to open a JSON file is usually straightforward once you choose a tool that fits your needs. If you can no longer find the file rather than simply open it, check your backups and other available copies first. When the JSON file is deleted or lost without a backup, 4DDiG can scan the affected storage and help you find recoverable data.

William Bollson (senior editor)

William Bollson, the editor-in-chief of 4DDiG, devotes to providing the best solutions for Windows and Mac related issues, including data recovery, repair, error fixes.

(Click to rate this post)

You rated 4.5 ( participated)