Skip to content
Tools

How to Open a JSON File on Windows, Mac, Linux and Phone

· 6 min read

A JSON file is plain text, so you can open it with any text editor (Notepad, TextEdit, VS Code) or drag it into a web browser. To read it comfortably, paste the contents into a browser-based JSON viewer that indents the data and shows it as a collapsible tree, without uploading anything.

The rest of this guide gives exact steps per platform, explains why a file sometimes looks like one endless line, and covers files that are too large for normal editors.

Quick answer by device

DeviceBuilt-in way to openBetter option
WindowsRight-click > Open with > NotepadVS Code or Notepad++, or a browser viewer
macOSRight-click > Open With > TextEdit, or select and press Space for Quick LookVS Code, BBEdit or a browser viewer
Linuxless file.json or any text editor (gedit, Kate)jq . file.json | less for indented output
Any browserDrag the file into a Firefox or Chrome windowFirefox's built-in JSON viewer
iPhone / iPadFiles app preview (plain text)A text editor app, or paste into a web viewer
AndroidDepends on the file manager; often no default appA text editor app, or paste into a web viewer

What is inside a JSON file?

A .json file holds data written in JavaScript Object Notation: objects in curly braces, arrays in square brackets, strings in double quotes, numbers, true, false and null. It contains no formatting, images or code that runs, which is why opening it is safe in any text editor. If you are new to the format, our guide to JSON syntax and data types explains every rule with examples.

A small, readable JSON file.
{
  "name": "Ada",
  "languages": ["en", "fr"],
  "active": true
}

Open a JSON file on Windows

  1. Right-click the file in File Explorer and choose Open with.
  2. Pick Notepad. If it is not listed, click Choose another app (or More apps on Windows 10).
  3. To always use the same app, tick Always use this app to open .json files before confirming.

Notepad shows the text exactly as saved. If the file was written by a program, that is often a single line with no spaces, and Notepad cannot reformat it. For that, use VS Code (free) and press Shift+Alt+F, Notepad++ with a JSON plugin, or a browser tool. Our article on formatting JSON in VS Code, Notepad++, Sublime and IntelliJ lists the exact menus and shortcuts for each editor.

Do not open JSON in Word or WordPad and save it again. Rich-text editors can change quotes into curly quotes or save in a different format, and the file will no longer parse.

Open a JSON file on a Mac

  • Quick Look: select the file in Finder and press Space to preview the raw text without opening an app.
  • TextEdit: right-click > Open With > TextEdit. If you edit and save, keep it as plain text (Format > Make Plain Text) so TextEdit does not add rich-text formatting.
  • Code editors: VS Code, BBEdit, Sublime Text and Xcode all open JSON with syntax colouring.
  • Browser: drag the file onto a Firefox or Chrome window.

Open a JSON file on Linux

Any editor works: gedit, Kate, nano or vim. In the terminal, less file.json pages through the raw text. If you have jq installed, pipe the file through it for indented, coloured output:

jq . file.json | less -R
# or, with only Python installed:
python3 -m json.tool file.json | less

For filtering rather than just reading, see the jq cheat sheet.

Open a JSON file in a web browser

Firefox has a built-in JSON viewer: drag a .json file into a tab (or open a JSON URL) and you get Raw Data, Pretty Print and a collapsible JSON tab with a filter box. Chrome and Edge display the raw text; recent Chrome versions add a Pretty-print checkbox at the top for JSON responses. Safari shows plain text.

Browsers are read-only. To edit, search by key, or check that the file is valid, paste the text into the JSON viewer and tree explorer. It runs entirely in your browser, which matters when the file contains customer data or API keys.

Open a JSON file on iPhone, iPad or Android

Phones do not ship a JSON app. On iPhone and iPad, tap the file in the Files app; the preview usually shows the raw text. On Android, the result depends on your file manager, and you may see "Can't open file". In both cases you have two options:

  • Install a plain-text or code editor app and open the file with it (Share > Open in, or Open with).
  • Copy the text and paste it into a JSON viewer in your mobile browser, which gives you a tree you can tap to expand instead of a wall of text.

Why does my JSON file look like one long line?

Programs usually save JSON minified, with every space and line break removed to save bytes. The data is complete; it just has no indentation. Paste it into the online formatter to pretty-print it with two- or four-space indentation, or use the editor shortcuts above.

What if the file is too big to open?

Notepad, TextEdit and many online tools freeze on files over roughly 50 to 100 MB, and some online tools reject anything larger than a few megabytes. Options that cope better:

  • The large JSON viewer streams the file inside your browser so you can browse and search it without uploading.
  • On the command line, jq can pull out just the part you need, for example jq '.items[0]' big.json.
  • If the file has one JSON value per line (NDJSON), head -n 20 big.json shows the first records instantly.

The full playbook, including search strategies and memory limits, is in how to open and search huge JSON files.

What if the file will not open or shows an error?

  • Garbled characters: the file may be compressed (.json.gz) or in a different encoding. Decompress it first; JSON exchanged between systems should be UTF-8.
  • A viewer reports a syntax error: the text is not valid JSON. Run it through the JSON validator to find the exact line, and see common JSON errors and how to fix them.
  • The file is actually JSONC or JSON5: config files such as tsconfig.json allow comments. Editors open them fine, but strict parsers reject them.

FAQ

What program opens a JSON file?

Any text editor opens a JSON file because it is plain text: Notepad on Windows, TextEdit on Mac, gedit or nano on Linux. Code editors such as VS Code add colours and formatting, and Firefox shows JSON as an interactive tree.

How do I open a JSON file in Notepad?

Right-click the file, choose Open with > Notepad (or Choose another app if Notepad is not listed). Notepad cannot indent JSON, so minified files appear as one line; paste the text into a JSON viewer or use Notepad++ with a JSON plugin to make it readable.

How do I open a JSON file on my phone?

On iPhone, tap it in the Files app to preview the text. On Android, open it with a text editor app. For a readable tree view, copy the contents into a browser-based JSON viewer.

Can I convert a JSON file to Excel to open it?

Yes. Convert it to CSV with a JSON to CSV converter, then open the CSV in Excel. Nested objects are flattened into columns such as address.city.

Is it safe to open a JSON file?

Opening a JSON file in a text editor or viewer is safe because JSON is data, not executable code. Be careful where you paste it: online tools that upload the file can expose any tokens or personal data it contains.

More JSON guides