File Format Guide

What Is a JSON File?

How to open, read, validate, and use .json data in modern web apps and APIs.

{
  "format": "JSON",
  "extension": ".json",
  "standsFor": "JavaScript Object Notation",
  "humanReadable": true,
  "languageIndependent": true,
  "universal": true
}
Plain Text
Readable by humans, safe, and works in any text editor.
Universal Standard
Supported natively across Python, Java, JS, Go, and APIs.
Background & Origins

What Does JSON Stand For?

JavaScript Object Notation

Created by Douglas Crockford in the early 2000s as a simpler, lighter alternative to XML for transmitting data between web servers and browsers.

Despite "JavaScript" in the name:

JSON is completely language-independent. It is parsed and generated natively by Python, Ruby, Java, PHP, Go, Rust, Swift, and C#.

The "Object Notation" Idea

Data is organized like real-world entities: named properties mapped to specific values.

Real-World Mapping:
• Real Object: A user with a name, age, and email
• JSON Object: {"name": "Alice", "age": 34}
Easy for humans to write. Trivial for machines to parse.
Core Structure

Anatomy of a JSON File

{
  "name": "Alice Johnson",
  "age": 34,
  "email": "alice@example.com",
  "isPremium": true,
  "skills": [
    "JavaScript",
    "Python",
    "CSS"
  ],
  "address": {
    "city": "New York",
    "country": "US"
  }
}
Curly Braces { }

Wrap an object — an unordered collection of key/value pairs.

Key : Value Pairs

Keys are always wrapped in double quotes, separated by a colon.

Square Brackets [ ]

Wrap an array — an ordered list of multiple items.

Supported Data Types

Strings "text", Numbers 34, Booleans true/false, null, Arrays [], and Objects {}.

Real-World Ecosystem

Where Do JSON Files Come From?

Web APIs response.json

Transmitting live data across web services (weather forecasts, payment gateways, social feeds).

App Configuration settings.json

Editor settings, VS Code configurations, and developer project manifests like package.json.

Database Exports export.json

Native format for NoSQL document stores such as MongoDB, Firebase Firestore, and CouchDB.

Translation & State en.json, state.json

Internationalization string catalogs (i18n) and cached browser session storage.

Tooling & Inspection

How to Open & Read a JSON File

1
Text Editor
Quickest

Right-click and open with Notepad or TextEdit. 100% safe because JSON contains no executable code.

2
VS Code
Best for Devs

Syntax color coding, tree collapse, auto-formatting, and instant red squiggles on syntax errors.

3
JSONLint
Web Validator

Paste into jsonlint.com to validate formatting and pinpoint exactly which line or bracket is broken.

4
Web Browser
For API Feeds

Drag-and-drop into Chrome, Firefox, or Edge. Modern browsers format and nest JSON automatically.

Evolution of Data Formats

JSON vs XML

Aspect JSON (Modern Standard) XML (Legacy / Documents)
Readability High — clean and concise syntax Verbose — repetitive tags
Payload Size Smaller — minimal transmission overhead Larger — tag repetition bloat
Parsing Speed Fast & native in all languages Heavier DOM tree parsing required
Comments Not supported (pure data only) Supported (<!-- -->)
Primary Usage REST APIs, configs, mobile apps Legacy enterprise & document formats
Best Practices & Syntax Errors

Common JSON Errors & Golden Rules

1. Trailing Commas

Commas after the last element break parsers instantly.

{"name": "Alice",}
{"name": "Alice"}
2. Single Quotes

JSON strictly demands double quotes for all strings & keys.

{'role': 'admin'}
{"role": "admin"}
3. Unquoted Keys

Unlike plain JS objects, JSON keys must always be strings.

{id: 101}
{"id": 101}
💡
The Golden Rule: Validate Before You Deploy
A single syntax error fails the entire file. Drop your code into jsonlint.com or your code editor to verify before shipping to production.
Made with Slides.com