Skip to content
Related Articles

Related Articles

How to open json file ?

View Discussion
Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 31 Oct, 2021

A JSON file stores the data and object in the JSON format. A JSON ( JavaScript object notation )format is a standard format to store and exchange data. Initially, JSON file is only used to exchange the data between the web application and server. Now, it is used for many purposes such as to take and restore the data backup.

Users can create a JSON file with the .json extension. It is a simple text-based and human-readable file that we can edit and read in the compatible text editor. JSON file doesn’t take too much space to store the data as it is a plain text file.

How to create JSON files?

Before we learn to open the JSON files, we need to create them. To create a sample JSON file follow the below basic steps.

  1. Open the text editor on your computer.
  2. Create a new file and save it.
  3. Users need to save files with the .json extension.
  4. Copy the below sample JSON code and paste into a file and save it again.

 

Sample JSON code:

Javascript




/* sample json code */
{
    "firstName": "fname",
    "lastName": "lname",
    "gender": "male",
    "age": 25,
    "address": {
        "streetAddress": "26 colony",
        "city": "Ahemdabad",
        "state": "Gujarat",
        "postalCode": "354323"
    },
    "phoneNumbers": [
        { "type": "business", "number": "9323227323" }
    ]
}


How to open JSON files?

We have created a sample JSON file successfully. In this section, we will discuss tools to open JSON files.

Cross-platform to open JSON files: Generally, users can open the JSON file in any text editor as it is a plain text-based file. The Google Chrome and Mozilla Firefox web browsers are cross-platform to open JSON files that are compatible with every operating system (OS). Users can follow the below steps to open JSON files in Chrome or Firefox browsers.

  • Right-click on the JSON file.
  • Choose open with option from the menu.
  • From the drop-down menu either choose Chrome or Firefox.

  • If you are not able to find the chrome in-app menu, click on Choose another app. Here, you will find chrome and firefox listed.

The user will see the following output when the JSON file will open in the browser.

However, users can directly copy the location path of the JSON file and copy it to the browser to read the file. Every operating system supports different text editors. Here, we have provided the list of best text editors for every operating system.

Operating system List of Text Editor
Windows Microsoft Notepad, Microsoft Word, VS Code, Atom
Mac Apple TextEdit, Mac VIm
Linux Vim editor, PICO
Android File viewer for Android (application)

A user can open and edit JSON files with any text editor from the above table. If users do not want to download any tools or applications to open JSON files, they can edit them with online tools. Users should have a working internet connection to edit JSON files online.

Edit JSON files online

  • Open any browser and search for ‘Online JSON editor ‘.
  • Click on the first link in the result.

  • The JSON editor is open and you can read files from the local computer. You can also edit JSON files and save them locally or to the cloud.
  • Online tools like these save you from having to download offline tools.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!