Development

JSON for Beginners: What It Is and How to Read It

If you have ever interacted with an API, opened a config file, or browsed a modern website's source code, you have almost certainly encountered JSON. It looks intimidating at first, but once you understand the structure, it becomes very easy to read.

What Is JSON?

JSON stands for JavaScript Object Notation. It is a lightweight, human-readable format for storing and transporting data. Despite the name, JSON is widely used by Python, PHP, Java, Ruby, and virtually every programming language.

A Simple JSON Example

{
  "name": "Alice",
  "age": 28,
  "isStudent": false,
  "skills": ["JavaScript", "Python", "CSS"],
  "address": {
    "city": "London",
    "country": "UK"
  }
}

JSON Data Types

  • String: Text in double quotes — "Hello World"
  • Number: Integer or decimal — 42 or 3.14
  • Boolean: True or false — true or false
  • Null: Represents nothing — null
  • Array: Ordered list in square brackets — ["a", "b", "c"]
  • Object: Key-value pairs in curly braces — {"key": "value"}

Where Is JSON Used?

  • APIs: When apps communicate with servers, data is almost always sent as JSON
  • Config files: package.json (Node.js), settings.json (VS Code), manifest.json (browsers)
  • Databases: MongoDB, Firebase, and PostgreSQL all support JSON natively
  • Local Storage: Browser localStorage stores data as JSON strings

💡 Common mistake: JSON keys must always be in double quotes. {name: "Alice"} is NOT valid JSON. The correct format is {"name": "Alice"}.

How to Validate JSON

If your JSON is broken or incorrectly formatted, it will cause errors in any application trying to use it. A JSON formatter tool instantly highlights syntax errors so you can fix them. Look for: missing commas, unclosed brackets, or single quotes instead of double quotes — the three most common mistakes.

Format and Validate Your JSON — Free

Paste messy JSON and get beautifully formatted, validated output in one click.

Open JSON Formatter