๐Ÿงฉ
#developer#JSON#beginner

JSON Explained for Complete Beginners (With Real Examples)

Himanshu RathoreMarch 12, 20265 min read

JSON is everywhere on the internet โ€” in APIs, config files, and databases. Here's a plain-English guide that makes JSON finally make sense.

What Is JSON?

JSON stands for JavaScript Object Notation. Despite the "JavaScript" in the name, it's used in virtually every programming language. It's a lightweight way to store and transport data.

Think of it like a digital form โ€” structured data that both humans and machines can read.

JSON Syntax Rules

JSON has just a few rules:

  • Data is in name/value pairs
  • Data is separated by commas
  • Curly braces hold objects
  • Square brackets hold arrays
  • String values must use double quotes
  • A Simple Example

    {
      "name": "Himanshu",
      "age": 28,
      "isActive": true,
      "skills": ["JavaScript", "Python", "Design"],
      "address": {
        "city": "Mumbai",
        "country": "India"
      }
    }

    JSON Data Types

    TypeExample
    String"hello world"
    Number42 or 3.14
    Booleantrue or false
    Array[1, 2, 3]
    Object{"key": "value"}
    Nullnull

    Where You'll Encounter JSON

    • APIs: When you fetch data from the internet (weather, maps, payment), it almost always comes back as JSON
    • Config files: package.json in Node.js, settings.json in VS Code
    • Databases: MongoDB, Firebase, and other NoSQL databases store data in JSON-like formats
    • Local Storage: Browsers store web app data as JSON strings

    Conclusion

    JSON is one of those things that seems intimidating at first but becomes completely natural after a few encounters. Once you recognize the pattern, you'll see it everywhere โ€” and know exactly how to read and write it.

    Found this helpful?
    Back to Blog