What is JSON?
Learn what JSON is, why APIs use it, common syntax rules, and which ToolHub utilities help you format and validate payloads locally.
JSON (JavaScript Object Notation) is a lightweight text format for structured data. Despite the name, you do not need JavaScript to use it—almost every modern language ships a JSON parser. APIs return JSON, config files store JSON, and browsers speak JSON when talking to backends.
Why JSON won for APIs
JSON maps cleanly to objects, arrays, strings, numbers, booleans, and null. It is stricter than “JavaScript object literal” syntax: keys must be double-quoted, comments are not allowed, and trailing commas are invalid. That strictness makes parsers predictable across platforms.
Core syntax rules
- Objects use
{ "key": "value" }pairs. - Arrays use
[ value, value ]lists. - Strings use double quotes only.
- Numbers are decimal literals (no hex in standard JSON).
true,false, andnullare bare literals.
When a payload fails, the first error is usually a missing quote, a trailing comma, or an accidental comment copied from a config dialect.
Everyday workflows
- Pretty-print a minified API response so you can read nested fields.
- Validate before shipping a request body.
- Minify after editing so transport stays compact.
- Convert to YAML when humans need to edit the same structure in a repo.
Practice on ToolHub
Use JSON Formatter to format and minify locally, JSON Validator for clear parse errors, JSON Minifier when you only need compression, and JSON ↔ YAML when configs move between formats. Nothing in these tools requires uploading your payload to ToolHub.
Related reading
If you see JSON wrapped for transport, continue with What is Base64?. If tokens embed JSON claims, continue with What is JWT?.
Try related tools
Keep exploring
- learnWhat is Base64?Learn Base64 encoding—why APIs use it, how it differs from encryption, and how to encode or decode strings locally in your browser.
- learnWhat is JWT?Understand JSON Web Tokens—header, payload, signature—and how to inspect claims locally without treating decoding as verification.
- collectionJSON ToolkitFormat, validate, minify, and convert JSON locally—ideal for API debugging and config work.
- collectionText ToolkitCount words, trim whitespace, sort or dedupe lines, find and replace, and more—entirely in your browser.
- compareJSON vs YAMLCompare JSON and YAML for configs and APIs—syntax, tooling, and when to convert between them.
- compareRegex vs Dedicated ParsersWhen regular expressions help—and when JSON/HTML/URL parsers are the safer choice.
- compareJSON Formatter vs JSON ValidatorPretty-printing versus strict syntax checking—compare which JSON tool to open for reading, debugging, or gating a payload.
- compareMinify vs Prettify JSONCompact single-line output versus indented structure—compare when to shrink JSON and when to expand it.