How to create a JSON File?

To create JSON file first we need to understand what is JSON and what it represents. Please check out this link to find more about the JSON What is JSON?
Once we understand JSON, there are 3 ways to create a new JSON.
- Using Text Editor
- Using Online Tools such as https://jsonformatter.org
- Create a file from the JSON URL
1. Using Text Editor
Open a Text editor like Notepad, Visual Studio Code, or Sublime or your favorite one.
Cope and Paste below JSON data in Text Editor or create your own base on the What is JSON article.
{
"InsuranceCompanies": {
"Top Insurance Companies": [
{
"No": "1",
"Name": "Berkshire Hathaway ( BRK.A)",
"Market Capitalization": "$308 billion"
}
],
"source": "investopedia.com",
"Time": "Feb 2019"
}
}
Use this JSON validator tool to validate the JSON
https://codebeautify.org/jsonvalidator
Once file data are validated, save the file with the extension of .json, and now you know to create the Valid JSON document.
2. Using Online Tool
Open a JSON Formatter tool from the link below
Copy and Paste the JSON Data which is mention in Option 1 in the Input tool of the online tool

Download this file using the download icon mentioned on the Right input area. It will download the JSON file.
This jsonformatter.org already support the JSON validation. This will create a New JSON file and will allow downloading.
Now if you already have JSON document or file, you can upload it to this tool and modify or delete few objects, array of the JSON and download the updated and valid JSON file
3. create a file from the JSON URL
Developer needs to work with API and nowadays 95% API returns data as JSON.
Here are few samples of the JSON URL. Now click on these JSON samples.
- https://gist.githsubusercontent.com/jimmibond/9205480889e19c0de347/raw/sample.json
- https://gist.githubusercontent.com/cbmgit/852c2702d4342e7811c95f8ffc2f017f/raw/InsuranceCompanies.json
Once they are open use save as functionality of the browser and save these file.
I hope this article helps you to understand basic ways to create JSON file a Valid and formatter.