How to open a JSON file and read its contents

How to open a JSON file and read its contents

Choose how to open a JSON file based on what you need to do: edit its text in a local editor or inspect its structure in a browser viewer. Keep an unchanged copy before saving edits.

Choose whether to read or edit the file

A JSON document contains structured text. RFC 8259 defines JSON as a text-based data interchange format. An object groups named values inside braces, while an array lists values inside square brackets. You can read the text directly or use a viewer to explore those groups.

If double-clicking opens the wrong app, start your chosen text editor and use its Open File command. For example, Visual Studio Code's documented shortcut is Ctrl+O on Windows and Linux, or Command+O on macOS. Select the JSON file from that dialog. You can read it without changing the operating system's default app for every JSON file.

A local editor is the appropriate route for a document that your organization requires you to keep off websites. Remove passwords, access tokens and private records from any example you intend to share. Reading a data file does not require executing it as JavaScript or running a command copied from its contents.

VS Code's JSON editing documentation describes syntax assistance, formatting and folding for JSON files. The editor also has a separate JSON with Comments mode. A file accepted in that mode may still fail in a strict JSON parser. Use the format the receiving program expects when editing a configuration file.

How to open a JSON file and find a value

To inspect a nonprivate file as a tree, open JSON Viewer and choose Upload .json, or paste the text into JSON input. Press View. Expand an object's arrow to see its keys and an array's arrow to see its items. Search highlights matching keys and values. Selecting a row shows its path; Copy value copies the selected value.

The viewer accepts files up to 10 MB. To change a value in its read-only tree, edit the input and run View again, or use your local editor. Pasted text and local files are processed in the browser. From URL tries a browser request first and may use Utilza's server to fetch the public response. Avoid URLs containing secrets.

This synthetic example has one record inside an array. The record code is a string, so its leading zeros are part of the value:

{
  "export": {
    "records": [
      {
        "code": "00123",
        "name": "Sample record",
        "requestId": 12345678901234567890
      }
    ]
  },
  "note": "Line one\nLine two"
}

Open export, then records, then the first array item, numbered 0. Its code field has the path $.export.records[0].code and the value "00123". The quoted string differs from the unquoted requestId number. Keep that distinction when copying identifiers into another system.

For a file that is one long line, use JSON Formatter. Paste it or upload a file within its 5 MB limit, choose Beautify and an indentation style, then press Format. Copy the result or download a separate .json file. The formatter preserves number and string literals; it does not need to turn this document into JavaScript numbers to indent it.

A local check on October 28, 2026 ran this example through Utilza's current parser and formatter modules in Node.js v24.15.0 on Windows. Formatting preserved "00123" and the literal 12345678901234567890. Minifying the formatted copy produced the exact original compact text. This checks those modules and that fixture; it does not test a browser upload, OS file associations or the VS Code interface.

If the viewer reports an error instead of a tree, keep the source and read the first reported line and column. The guide to finding an invalid JSON error explains that separate troubleshooting task. If your eventual destination is a spreadsheet, the guide to converting nested JSON to CSV explains how arrays, missing fields and identifier columns change in a flat table.

Open a JSON file without replacing the original

  1. Keep a copy of the downloaded JSON. Choose a local text editor if the file must stay off websites; otherwise a browser viewer can help you inspect its structure.
  2. In a local editor, use Open File and select the file. In JSON Viewer, use Upload .json or paste its text, then press View. The viewer's file limit is 10 MB.
  3. Expand the object or array you need. Search for a known key or value, select the matching row and copy its path or value.
  4. If you want indented text, open JSON Formatter, load a file within its 5 MB limit and choose Beautify. Download the formatted copy under a different name.
  5. If parsing fails, read the first line and column in the error and inspect that location. Check that the file is JSON rather than a downloaded sign-in page, an incomplete response or a different configuration format.
  6. Before passing a value to another app, check its type and full text. Keep string identifiers such as 00123 quoted, and compare long numeric identifiers against the source.
  7. Keep the original file after saving a readable copy. Make deliberate edits in your editor or the tool's input; expanding or searching the tree does not edit the source.

What opening a JSON file does not establish

  • A text editor can display a document that a JSON parser rejects. Seeing readable text does not prove valid syntax or that the fields meet an API's requirements.
  • The viewer's 10 MB limit and the formatter's 5 MB limit are different. A very large file may need a local editor or a separate data-processing workflow; do not cut the source in half and expect complete JSON.
  • The current viewer is a read-only tree. It does not write an edited configuration file back to your computer.
  • Comments and trailing commas are rejected by these strict JSON tools. Some configuration formats allow them; check the intended application before removing them.
  • A filename ending in .json does not guarantee JSON content. In the local fixture check, an HTML sign-in response was rejected at its first character.
  • Formatting changes presentation. It does not repair a truncated download, decrypt a file, restore missing records or prove that the data is trustworthy.

Frequently asked questions

What program can I use to open a JSON file?

Use a text editor to read or edit the text, or a JSON viewer to inspect objects and arrays as a tree. For files that must stay off websites, choose a local editor.

Why is my JSON file one long line?

JSON does not need indentation between values. Use Beautify in JSON Formatter for a readable copy, or open the original in JSON Viewer to inspect its tree.

Can I open a JSON file without converting it?

Yes. It is text that an editor can display directly. A viewer parses that text to show its structure. Conversion to CSV is only needed when your destination requires a table.

Why can I read the file in an editor but the JSON viewer reports an error?

The editor can show text even when it is invalid JSON. Check the reported line and column for an incomplete download, comments, a trailing comma or content such as an HTML page.

Tools used in this guide

  • JSON ViewerDeveloper Tools

    Shows JSON as a collapsible tree with search and copyable paths.

More from the blog

All guides