Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

What Is JSON?

JSON is a simple way to write down information so programs can share it. This guide explains how it looks and how to read it.

Web Hosting2 min read8 steps

What does JSON mean?

JSON stands for JavaScript Object Notation. It is a plain text format. It was born from the JavaScript language, but almost every language can read it. Think of it as a neat form with labels and answers, like "name: Sam".

Why is it used?

  • Websites and apps use it to send data to each other. A system that lets programs talk is called an API.
  • It is used in settings files, such as package.json or composer.json.
  • It is easy for people to read and easy for computers to read.

What it looks like

{
  "name": "Sam",
  "age": 12,
  "student": true,
  "hobbies": ["chess", "football"],
  "address": {
    "city": "Pune"
  }
}

This describes one person. Each line is a pair: a name (called a key) and its value.

The building blocks

  • Object: a group of pairs inside curly braces { }.
  • Array: a list inside square brackets [ ].
  • String: text inside double quotes, like "Sam".
  • Number: a number with no quotes, like 12.
  • Boolean: true or false.
  • null: means "nothing here".

Rules to remember

  1. Keys must be in double quotes. Single quotes are not allowed.
  2. Separate items with commas.
  3. Do not put a comma after the last item.
  4. Comments are not allowed in plain JSON.
  5. Every opening bracket needs a closing one.

How to check your JSON

  1. Copy your text.
  2. Paste it into a JSON validator. This is a free online tool that finds mistakes. Many code editors check JSON as you type.
  3. Fix any line it points to.

Warning: Do not paste private data, such as passwords, into online tools.

Tip: A missing comma or an extra comma is the most common JSON mistake.

If a settings file on your hosting will not load, ask support for help.

Quick recap

  • JSON is a text format for sharing data.
  • It uses key and value pairs, objects and arrays.
  • Keys and text use double quotes.
  • Watch your commas and brackets.
  • Use a validator to find mistakes.