seolivly
JSON basics

How to Open a JSON File and Make It Readable

A JSON file is plain text, so almost anything can open it. The hard part is reading it when it arrives as one endless line.

What a JSON file is

A .json file holds structured data as plain text: names and values inside curly braces, lists inside square brackets. Apps use it for settings, exports and data sent between servers. Because it is text, you never need special software to open it, only something that shows text.

Opening a JSON file on Windows

  • Notepad: right-click the file, choose Open with, then Notepad. Fine for small files.
  • A web browser: drag the file into Chrome, Edge or Firefox. Firefox shows JSON in a collapsible viewer with a "Pretty Print" option; Chrome and Edge show the raw text.
  • A code editor such as Visual Studio Code gives syntax colouring and can format the document for you.

Opening a JSON file on a Mac

  • TextEdit: right-click the file, choose Open With > TextEdit.
  • A browser: drag the file into Safari, Chrome or Firefox.
  • Quick Look: select the file in Finder and press Space for a fast peek at the contents.

Opening a JSON file on a phone

Phones do not ship with a text editor in the usual sense. The simplest route is to open the file in a browser or in the Files app's preview, copy the contents, and paste them into the JSON formatter, which works in mobile browsers.

Making it readable

Exports and API responses are often minified: every space and line break removed to save bytes. The data is fine, but a 2,000-character single line is unreadable. To fix it:

  1. Copy the file's contents.
  2. Paste them into the JSON formatter.
  3. Press Format. Each key gets its own line, nested data gets indented, and keys, strings and numbers are colour-coded.
  4. Tick Sort keys if you are comparing two files, so matching keys line up in the same order.

If Format reports an error, the file is not valid JSON. Our guide on fixing invalid JSON walks through the usual causes.

What the parts of a JSON file mean

  • { } holds an object: a set of named values, like a record.
  • [ ] holds an array: an ordered list.
  • "key": value pairs name each piece of data. Keys are always in double quotes.
  • Values can be text in double quotes, numbers, true, false, null, or another object or array.

Once formatted, the indentation shows the nesting at a glance: everything indented under a key belongs to it.

Opening JSON in Excel or Google Sheets

If the JSON is a list of similar records, a spreadsheet can be easier to scan. Recent versions of Excel can import JSON through the Data tab's Get Data options, which opens Power Query to flatten it into rows. Nested data needs some expanding in that editor. For a quick look at a small file, formatting it as text is often faster.

Frequently asked questions

What program opens a JSON file?

Any text editor or web browser. Notepad, TextEdit, VS Code, Chrome and Firefox all work.

Why is my JSON file all on one line?

It was minified to save space. A JSON formatter adds line breaks and indentation without changing the data.

Is it safe to open a JSON file?

Opening it as text is safe because JSON cannot run code. Be careful about what you do with its contents, such as pasting secrets into websites that upload data.

Can I edit a JSON file?

Yes, in any text editor. Validate it afterwards, because one missing comma or quote will stop the app that reads it.

How do I convert JSON to CSV?

Spreadsheet tools like Excel's Power Query can flatten a JSON list into rows, which you can then save as CSV.

Keep going