Skip to content

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, and null are 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

  1. Pretty-print a minified API response so you can read nested fields.
  2. Validate before shipping a request body.
  3. Minify after editing so transport stays compact.
  4. 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