What is a JSON file?

Spread the love

What is a JSON file?

Are you looking for JSON Files? Then it’s Here.

A JSON(JavaScript Object Notation) File contains a JSON object and JSON Array. Files are easily editable with any text editor like Notepad.

JSON is used for exchanging data over the internet same as XML. You can send and receive data through JSON. for example, if we want to showcase any data on a webpage then we can use JSON to pass data from server to webpage.

All JSON data has a name and value pair that is separated by a colon(:).

The MIME type for JSON text is “application/JSON”

You can refer to the below files. This file contains that JSON object.

{
    "firstName": "Racks",
    "lastName": "jacson",
    "gender": "man",
    "age": 24,
    "address": {
        "streetAddress": "Udhna",
        "city": "San Jone",
        "state": "CA",
        "postalCode": "95221"
    },
    "phoneNumbers": [
        { "type": "home", "number": "27627" }
    ]
}

How to create a JSON file?

If you are finding how to create a JSON file then Check out the below article for this.

It is simple and easy with any text editor you can create JSON files.

how to create JSON file?

How to open a JSON file?

If you want to open a file in your local, then you can open it into any text editor that will not format that file but will open it.

Visual Studio Code has an extension to format JSON.

How to open JSON file in Chrome

Your local file will also open in Chrome and many extensions are available for format JSON.

Just open it with Google Chrome and your file will open to Chrome. directly JSON URL is also open to Chrome. try with below JSON API below.

It looks like the below picture. it is an easy and simple file that is open in the browser.

Display JSON File Chrome

Open JSON file online

For online you can use awesome tools JSON Beautifier that will help to open the file from URL and Local drive. It will help to edit the file online.

Sample JSON files

Check the below article.

Sample JSON file

 

You can also call sample-JSON API directly.

https://tools.learningcontainer.com/sample-json.json

You need to save the above code with the .json extension.
You can refer to https://tools.learningcontainer.com/jsonviewer/ to display data in the proper format and you can compare it to JSON file https://jsoncompare.org. If you want to create JSON files online then use https://jsonbeautifier.org