What you need to know before you start

A JSON file is a text file that stores data in a specific format — it uses curly braces, square brackets, and quotation marks in exact places. You can edit it with any text editor, but the format has to stay perfect or the file stops working. The most common mistake is deleting a comma, adding an extra one, or forgetting a quotation mark. A single misplaced character breaks the whole file.

You do not need special software. Notepad on Windows, TextEdit on Mac, or any code editor will work. The difference is that a code editor like Visual Studio Code will highlight your mistakes in real time, while Notepad will not. If you are editing JSON for the first time, a code editor saves you hours of hunting for the error.

Key Takeaways

  • Open JSON files in a text editor or code editor — Notepad works, but Visual Studio Code shows you mistakes as you type.
  • Every opening curly brace { needs a closing one }, and every opening square bracket [ needs a closing one ] — count them to make sure they match.
  • Text values must be wrapped in quotation marks, but numbers and true/false do not need them.
  • Commas separate items in a list or properties in an object, but the last item never has a comma after it.
  • Save the file with the .json extension so programs know what format it is.

Opening the file in the right editor

Right-click the JSON file and choose Open with. On Windows, pick Notepad if you want something simple, or download Visual Studio Code for free if you want help spotting errors. On Mac, right-click and choose Open With, then select TextEdit or download Visual Studio Code.

Visual Studio Code is the easiest choice because it color-codes different parts of the JSON and shows you a red squiggly line when something is wrong. It also tells you exactly which line the error is on. If you use Notepad or TextEdit, you have to check the format yourself, which is slower but still possible.

Do not open JSON files in Microsoft Word or Google Docs — these programs add invisible formatting that breaks the file. Stick to plain text editors only.

Understanding the structure so you do not break it

JSON uses three main symbols to organize data: curly braces {} for objects, square brackets [] for lists, and quotation marks "" for text. A simple JSON file looks like this:

{ "name": "John", "age": 30, "city": "Portland" }

The curly braces wrap the whole thing. Inside, each line has a property name in quotes, a colon, and a value. Text values like "John" and "Portland" need quotes. Numbers like 30 do not. A comma separates each line from the next, but there is no comma after the last one.

If you have a list of items, use square brackets instead. This example shows a list of cities:

{ "name": "John", "cities": ["Portland", "Seattle", "Vancouver"] }

The square brackets hold the list. Each item is separated by a comma, and the last item has no comma after it. This rule — no comma after the last item — trips up most people.

Making changes without breaking the format

Start by finding the part you want to change. If you are editing in Visual Studio Code, use Ctrl+F (Windows) or Cmd+F (Mac) to search for the word. Make your change, then check that you did not accidentally delete a quotation mark, comma, or bracket.

If you are adding a new line, remember the format: "property": "value", with a comma at the end — unless it is the last item in the object, in which case there is no comma. If you are deleting a line, make sure the line before it does not end with a comma if it is now the last line.

After you make changes, save the file. In Visual Studio Code, press Ctrl+S (Windows) or Cmd+S (Mac). If there is a red squiggly line or an error message, fix it before you close the file. If you are using Notepad or TextEdit, save and then open the file in Visual Studio Code to check for errors.

Checking your work for errors

The fastest way to check is to open the file in Visual Studio Code. If there are errors, it shows a red circle with an X on the line number where the problem is. Click that line and read the error message — it usually tells you exactly what is wrong.

If you do not have Visual Studio Code, you can paste your JSON into a free online JSON validator. Search for "JSON validator" and paste your entire file into the tool. It will tell you if the format is correct or show you the line with the error.

Common errors are: a missing quotation mark, a missing comma between items, a comma after the last item, or mismatched brackets. Read through the file line by line and count the opening and closing brackets — they should match exactly.

Fixing errors when something goes wrong

If the file is broken, start by looking at the line the error message points to. Usually the problem is on that line or the line right before it. Check for a missing quotation mark, a missing comma, or an extra comma.

If you cannot find the error, undo your last change by pressing Ctrl+Z (Windows) or Cmd+Z (Mac) and try again. If you made many changes, undo back to the last version that worked, then make smaller changes one at a time and check after each one.

If the file is completely broken and you cannot fix it, you can restore it from a backup if you have one. If not, you may need to rebuild it from scratch or ask whoever created it for a fresh copy.

Saving the file so programs can read it

Always save the file with the .json extension at the end of the name. If you are using Notepad on Windows, click File > Save As, then type the full name including the extension: myfile.json. Make sure the file type is set to All Files, not Text Documents.

In Visual Studio Code, the extension is usually added automatically. Just type the name and press Save. If you are editing a file that already has the .json extension, do not change the name — just save it.

After you save, the file is ready to use. Programs that read JSON will now be able to open it and understand the data inside.

Frequently Asked Questions

Can I edit a JSON file on my phone?

Yes, but it is harder because you cannot see the whole file at once and spotting errors is slower. Use a text editor app like Jota+ on Android or Textastic on iPhone. For anything longer than a few lines, editing on a computer is much easier.

What if I need to add a quotation mark inside a text value?

Use a backslash before the quotation mark: \". For example, "quote": "He said \"hello\"". The backslash tells JSON that the quotation mark is part of the text, not the end of the value.

Do I need to indent the lines the way they are in examples?

No. Indentation makes the file easier to read, but it does not affect how the file works. You can put everything on one line and it will still be valid JSON. Most editors auto-indent for you, so just let them do it.

What happens if I open a JSON file in Word and save it?

Word adds hidden formatting that breaks the file. Do not do this. If you accidentally did, close without saving and open it again in a plain text editor. If you already saved it, restore from a backup or rebuild the file.

Can I use single quotes instead of double quotes?

No. JSON requires double quotes. Single quotes will break the file. This is one of the most common mistakes when people switch from other languages.