What Is JSON? A Practical Introduction
JSON syntax, data types, and why it became the standard format for APIs and configuration files, with real examples.
8 min read
Last updated 2026-07-19
Luis Avila
What Is JSON? A Practical Introduction explains JSON syntax and data modeling from the concepts that matter most to the decisions you make in practice. It focuses on how the technology works, where it fits, the tradeoffs to check, and how to avoid results that look correct but fail in a real workflow.
What will this guide cover?
- JSON in plain terms
- Objects, arrays, and values
- How applications use JSON
- Common uses
- Practical example
- Modeling and formatting practices
- Common errors and security
JSON in plain terms
JSON is a text format for representing structured data with objects, arrays, strings, numbers, booleans, and null. It is language-independent even though its syntax comes from JavaScript object notation. APIs, configuration files, browser storage, and message queues commonly use it because it is compact and widely supported.
Objects, arrays, and values
Objects store named properties inside braces, while arrays store ordered values inside brackets. Property names and string values require double quotes. JSON does not support comments, functions, undefined, dates, or trailing commas, those values must be represented using agreed conventions such as ISO 8601 date strings.
How applications use JSON
An application serializes an in-memory value into JSON before storage or transmission, then another application parses the text back into its own data structures. Parsing only confirms valid syntax. It does not guarantee that required properties exist or that values match the business rules.
Common uses
JSON is used for REST and GraphQL responses, application settings, package metadata, logs, localization files, and data import or export. It is a good fit for hierarchical data. CSV may be simpler for flat tables, while binary formats can be more efficient for very large or high-throughput workloads.
Practical example
A product can be represented as {"id":"sku-42","name":"Desk lamp","price":39.95,"available":true,"tags":["lighting","office"]}. The property order should not be treated as meaningful. Consumers should read values by key and handle optional fields explicitly.
Modeling and formatting practices
Use stable, descriptive property names and keep value types consistent across records. Represent money carefully, often as integer minor units or decimal strings when exact arithmetic matters. Format JSON for review, minify it for transport only when size is material, and validate external input before using it.
Common errors and security
Frequent syntax errors include single quotes, trailing commas, unescaped line breaks, and missing commas between properties. Do not assume parsed JSON is safe, an attacker can still supply unexpected keys, deeply nested structures, or oversized payloads. Apply schema validation, size limits, and authorization checks after parsing.
Frequently Asked Questions
No. JSON is a text format with stricter syntax. Keys must use double quotes, comments are not allowed, and values cannot include functions, undefined, dates, or other JavaScript-specific types.
JSON supports objects, arrays, strings, numbers, booleans, and null. Dates, binary data, big integers, and custom types must be represented using agreed string or object conventions.
The JSON grammar does not permit a comma after the final property or array item. Some JavaScript tools accept trailing commas, but a standards-compliant JSON parser will reject them.
Standard JSON cannot. Use documentation outside the file, a separate metadata field, or a format such as JSON5 when the entire toolchain explicitly supports it.
Consumers should not rely on object key order for meaning. Arrays preserve order, so use an array when sequence is part of the data model.
ISO 8601 strings such as 2026-07-19T14:30:00Z are a common choice. Document the timezone and parsing rules, because JSON itself has no date type.
It is convenient but can be memory-heavy because many parsers load the entire document. For very large streams, consider line-delimited JSON, pagination, compression, or a binary format.
Related Guides
Data & File Formats
JSON Validation Guide: Common Errors & How to Fix Them
The most common JSON syntax errors, trailing commas, unquoted keys, smart quotes, and how to find and fix each one.
6 min read Data & File FormatsWhat Is Base64 Encoding? A Practical Guide
Why Base64 exists, how it turns binary data into text, and where you'll actually encounter it, from emails to data URLs.
6 min read