Skip to content
Fundamentals

How to Open a JSON File on Windows, Mac, Android, and iPhone

·7 min read
How to Open a JSON File on Windows, Mac, Android, and iPhone - Fundamentals guide from JSON Prettifier

Quick answer: A JSON file is plain text, so any text editor or web browser can open it. Right-click the file, choose Open with, and pick Notepad, TextEdit, VS Code, or Chrome. If it shows up as one unreadable line, paste it into a free JSON formatter to add indentation.

Someone sent you a file ending in .json. Maybe it is an export from a web app, a data download from Google or Facebook, a game save, or a config file a developer asked you to check. You double-click it and either nothing happens or Windows asks what app to use.

Here is the reassuring part: there is nothing to install. JSON is text. This guide shows the fastest way to open one on every device, how to make it readable, and how to edit it without breaking it.

Open a valid sample in the JSON Viewer to explore objects and arrays as collapsible nodes alongside the formatted code.

What Is a JSON File?

JSON (JavaScript Object Notation) is a text format for storing structured data. A small file looks like this:

{
  "name": "Priya Nair",
  "email": "priya@example.com",
  "orders": 12,
  "premium": true
}

Curly braces hold a set of labelled values, square brackets hold lists, and text sits inside double quotes. Apps use it to move data between a server and your screen, which is why exports from most online services arrive in this format. If you want the full picture, start with What is JSON?. For opening and reading one, the example above is all you need.

How to Open a JSON File on Windows

  1. Right-click the file in File Explorer.
  2. Choose Open with, then Notepad. If Notepad is not listed, pick Choose another app and find it there.
  3. Tick Always use this app if you want double-click to work next time.

Notepad opens anything, but it does not colour the text or check for mistakes. For regular use, install VS Code (free). It highlights keys and values, folds sections, and flags a missing comma instantly. Our VS Code JSON guide walks through the setup.

Tip: dragging the file onto an open Microsoft Edge or Chrome window also works, and the browser shows the data as a collapsible tree.

How to Open a JSON File on Mac

  1. Right-click (or Control-click) the file in Finder.
  2. Choose Open With, then TextEdit.
  3. Press the space bar with the file selected for a Quick Look preview if you only need to glance at it.

One TextEdit gotcha: it may open in rich-text mode and add formatting when you save. Before editing, go to Format > Make Plain Text. Safari and Chrome on Mac open JSON files directly too. Developers usually reach for VS Code, Sublime Text, or the Terminal command cat file.json | python3 -m json.tool which prints the file with indentation.

How to Open a JSON File in a Browser

This is often the best option for reading, because Firefox and Chrome render JSON as an interactive tree you can expand and collapse.

  1. Open a new browser tab.
  2. Drag the file into the tab, or press Ctrl+O (Windows) / Cmd+O (Mac) and select it.
  3. In Firefox, switch between the JSON, Raw Data, and Headers tabs at the top. Chrome and Edge show the raw text and offer a Pretty-print checkbox.

Browsers cannot edit the file, but for reading and searching a large export they beat a text editor. If the file is tens of megabytes, our roundup of browser JSON formatters for large responses compares which ones stay responsive.

How to Open a JSON File on Android or iPhone

Android: open the Files app, tap the .json file, and choose a text editor or your browser from the list. If no app volunteers, long-press the file and use Open with.

iPhone and iPad: in the Files app, tap the file to preview it. The preview is read-only. To edit, use the Share button and send it to a text editor app, or to a notes app that handles plain text.

On either phone, the fastest way to get readable formatting is to open JSON Prettifier in the browser, paste the content, and tap Format. The page is mobile-friendly and processes everything on the device, so an export containing your personal data never gets uploaded anywhere.

Make a One-Line JSON File Readable

Many exports are minified: every line break and space was removed to make the file smaller, so it opens as a single enormous line. Nothing is broken. To restore the structure:

  1. Open the file in any editor and copy everything (Ctrl+A, Ctrl+C).
  2. Paste it into the left panel of JSON Prettifier, or drag the file onto the page.
  3. Click Format. Each value moves to its own indented line with colour highlighting.
  4. Click Download to save the readable version as a new .json file.

Prefer the command line? JSON pretty print shows the one-liners for Python, Node.js, and jq.

How to Edit a JSON File Safely

Editing is where most beginners break the file. JSON is strict about punctuation. Keep these rules in mind:

  • Text values and key names need straight double quotes: "name", not curly quotes or single quotes.
  • Every item except the last in a list or object ends with a comma. A comma after the last item is an error.
  • Numbers, true, false, and null are written without quotes.
  • Save as plain text with a .json extension, not .txt or .rtf.

After editing, paste the result into a validator and click Validate. It tells you the exact line of any mistake, which beats reopening the app to see whether it still works. The ten most common JSON errors explains each message you might see.

Opening JSON in Excel or Google Sheets

If the file is a list of records, such as orders or contacts, you may want it in a spreadsheet.

Excel for Windows: go to Data > Get Data > From File > From JSON. Power Query loads the file; click To Table, then use the expand icon on the column header to turn each key into its own column. Excel for Mac added the same connector in recent versions.

Google Sheets: there is no built-in JSON import. Convert the file to CSV first, or use an Apps Script. For nested data, flatten it before importing or the columns become unreadable.

Which Method Should You Use?

GoalBest optionWhy
Quick look at a small fileNotepad / TextEdit / Quick LookAlready installed, opens instantly
Read a large exportFirefox or ChromeCollapsible tree, search, no memory issues
Make a one-line file readableOnline formatterOne click, works on phone, nothing uploaded
Edit and check for mistakesVS CodeHighlighting, error underlines, auto-format
Analyse records in rows and columnsExcel Power QueryTurns arrays of objects into a table

Frequently Asked Questions

What program opens a JSON file?
Any plain-text editor opens a .json file: Notepad on Windows, TextEdit on Mac, or a code editor like VS Code. Modern browsers (Chrome, Firefox, Edge, Safari) also open JSON files directly and show a collapsible tree view. For a one-line file, paste it into an online JSON viewer to format it.
Why does my JSON file look like one long line?
It was minified to save space. All line breaks and indentation were removed before it was saved or sent. The data is intact. Paste it into a JSON formatter or open it in a browser to restore readable indentation.
Can I open a JSON file in Excel?
Yes, through Data > Get Data > From File > From JSON in Excel for Windows, which loads the file into Power Query. Flat arrays of objects import cleanly; deeply nested data needs to be expanded column by column. Google Sheets needs an add-on or a script.
How do I open a JSON file on my phone?
On Android, tap the file and choose a text editor or a browser; on iPhone, use the Files app and tap the file to preview it, or share it to a text editor. For readable formatting, open an online JSON viewer in your phone browser and paste the content.
Is it safe to open a JSON file?
Opening a JSON file in a text editor or browser is safe; it is plain text and cannot run code. The caution is the other direction: if the file contains personal data or API keys, avoid uploading it to tools that process files on a server.

Open and Read Any JSON File in Seconds

Drag your .json file onto JSON Prettifier or paste its contents. Formatted, highlighted, and searchable, with nothing sent to a server.

Open JSON Prettifier