.json · application/json

JSON: JavaScript Object Notation

JSON (RFC 8259) is the universal lightweight text format for nested key-value objects, typed arrays, strings, numbers, and booleans across browsers and backends.

Quick Answer: JSON (RFC 8259) is the universal lightweight text format for nested key-value objects, typed arrays, strings, numbers, and booleans across browsers and backends. REST/GraphQL APIs, structured application state, NoSQL documents, and machine-to-machine data exchange.

Structure typeHierarchical
Human readabilityHigh
Nesting supportYes
LLM token efficiencyLow
File extension.json
MIME typeapplication/json
Best forREST/GraphQL APIs, structured application state, NoSQL documents, and machine-to-machine data exchange.

Strengths

  • Native parsing and serialization in every browser and programming language
  • Supports arbitrary nested objects, arrays, booleans, nulls, and numeric types
  • Strict grammar prevents ambiguous indentation or implicit type coercion

Trade-offs

  • Repeats property keys on every array item, inflating LLM prompt token counts
  • Disallows comments and trailing commas in strict RFC 8259 parsers
  • Requires flattening before opening smoothly in spreadsheets like Excel

References

Convert & clean JSON locally

Related engineering guides

Related Formats

All 24 formats

JSON frequently asked questions

Why does JSON consume more LLM tokens than CSV or TOON?

Repeating quoted key names, braces, and colons for every row inside an array causes JSON to use 30% to 60% more tokens than tabular CSV or TOON.

How do I fix trailing commas or comments in JSON?

Strict JSON.parse rejects trailing commas and // comments. Use TxtTo's JSON Formatter with trailing-comma repair enabled to normalize JSON5-like payloads locally.

Can nested JSON objects be exported cleanly to CSV?

Yes. Flattening nested keys with dot notation (such as customer.city) turns deep JSON records into flat spreadsheet columns without losing values.