Skip to content

JSONWAY / FIELD GUIDE

Understand JSON. Choose the right format.

Start with an API response. Learn where JSON came from, where its limits are, and how other formats and open-source tools fit into your workflow.

Fundamentals · Format choices · Practical toolsSources checked

Where JSON came from

JSON (JavaScript Object Notation) is a text format for serializing structured data. Its syntax derives from JavaScript object literals, but it is language independent: Java, Python, Rust and C# can all use it. It is neither a database nor a programming language for executing logic. See RFC 8259 · JSON and ECMA-404.

RFC 8259 §1 traces JSON to the object literals of ECMAScript’s third edition. It was initially designed as a minimal, portable, textual subset of JavaScript. Web frontends and backends need to exchange nested records, lists and simple values; JSON expresses these with a small set of structures that the receiver can parse. Its simple, language-independent model, paired with parsing and serialization libraries in different languages, lets browsers, servers and other systems share a data contract. Numeric and type behavior still needs agreement across those implementations.

  1. 2006 · RFC 4627

    Douglas Crockford’s document described JSON and registered application/json; top-level text was limited to an object or array.

  2. 2013 · ECMA-404

    The first edition, published in October, independently defined the JSON interchange syntax.

  3. 2014 · RFC 7159

    Published in March, it replaced RFC 4627, allowed any JSON value at the top level and clarified interoperability.

  4. 2017 · RFC 8259 / ECMA-404

    RFC 8259 replaced RFC 7159 in December; the second ECMA-404 edition appeared that month. Their grammar aligns, while the RFC also gives interoperability guidance.

Syntax and boundaries

JSON has objects, arrays, strings, numbers, booleans and null. Object keys and strings need double quotes; objects use {} and arrays use []. The literals true, false and null are lowercase. The current grammar allows a string, number or any other JSON value at the top level; an API may still require an object.

  • Strict JSON has no comments, trailing commas, single-quoted strings, undefined, NaN or Infinity.
  • Dates and binary data need application conventions: date strings, time zones, timestamp units or Base64. Check seconds, milliseconds and zones in the timestamp converter too.
  • JSON exchanged outside a closed ecosystem must use UTF-8; network senders must not add a BOM. Escape newlines, double quotes and backslashes inside strings.

RFC 8259 · JSON · §§ 2–8

Choose a format

Start with the receiving system’s contract, then consider data shape and who maintains it. This comparison is about fit, not a ranking by age or speed.

JSON vs XML, YAML, Markdown, CSV and TOML
FormatGood fitStrengthsBoundaries
JSONAPIs and cross-language data exchangeObjects, arrays and simple types with broad library support.No comments, native dates or binary type; numeric precision depends on the parser.
XMLDocuments, established protocols, namespaced dataElements, attributes, mixed content, namespaces and DTD / XML Schema tooling.More verbose; mapping attributes, text and repeated elements to JSON needs a convention.
YAMLHuman-maintained configurationComments, indentation and anchors help maintain configuration.Whitespace and implicit typing need care; versions, schemas and parsers differ.
MarkdownDocumentation, tutorials and README filesLightweight markup designed for people to read and write.Not a general structured-data interchange format; dialect extensions vary.
CSVSpreadsheet exchange and flat recordsRows and columns are convenient for tabular data.No native nesting or universal field types; agree on delimiters, encoding and headers.
TOMLApplication and developer-tool configurationKeys, tables, comments and date-time types make configuration explicit.Designed for configuration rather than JSON’s arbitrary top-level values and interchange model.

YAML 1.2 aims for JSON compatibility, but accepted input and resolved types still depend on version, schema and implementation. Markdown primarily represents documents, not an equivalent JSON substitute. RFC 4180 describes CSV quoting and line breaks; spreadsheet applications may also use other dialects.

W3C · XML 1.0 · YAML 1.2.2 · CommonMark 0.31.2 · RFC 4180 · CSV · TOML 1.0.0

One record, six representations

These original library examples contain no personal data. They express similar information, but are not equivalent documents that can be round-tripped without conventions.

JSON

{
  "name": "River Library",
  "open": true,
  "books": 120,
  "tags": ["public", "reading"]
}

XML

<library>
  <name>River Library</name>
  <open>true</open>
  <books>120</books>
  <tags><tag>public</tag><tag>reading</tag></tags>
</library>

YAML

name: River Library
open: true
books: 120
tags:
  - public
  - reading

Markdown

# River Library

Open: yes. Books: 120.

- public
- reading

CSV

name,open,books,tags
River Library,true,120,"public,reading"

TOML

name = "River Library"
open = true
books = 120
tags = ["public", "reading"]

In this CSV example, the comma within tags is an application-level list delimiter, so the whole cell is quoted. CSV itself does not define arrays. XML text for open and books does not automatically gain JSON boolean or number types. The Markdown version is a human-readable description; core CommonMark does not define table syntax.

The open-source ecosystem

Use browser tools for a quick inspection, a CLI for repeated jobs, libraries in product code and a schema for a data contract. The projects below are independent third parties; JSONWay does not own or represent them.

jq

CLI filtering and batch processing

jq 'select(.open) | {name, books}' library.json

MIT core; documentation and bundled dependencies have separate notices · jq · license

Ajv

JavaScript / TypeScript

Validate structure against a selected JSON Schema draft, beyond pretty-printing.

MIT · Ajv · license

JSON5

Extended syntax for hand-written files

Supports comments and other extensions; convert with a compatible parser before sending to a strict JSON API.

MIT · JSON5 · license

Documentation and licenses checked November 19, 2026. The Jackson license link is for 2.x; other links point to the official documentation or branches consulted. Check LICENSE / NOTICE files for the actual release and dependencies you use. This guide links to projects and does not bundle their code.

Put it into practice

Choose your current task for a starting point. The complete comparison and examples remain available above.

  1. Keep the original; confirm format, encoding and the receiving system’s contract.
  2. Inspect structure with the JSON formatter and syntax validator, or use JSON diff to compare responses.
  3. Try JSON to CSV for flat arrays of records. Convert existing configuration or protocol data with YAML to JSON or XML to JSON, then verify the mapping.
  4. Use Markdown preview for documents. Move repeated work to jq or a library, and structural constraints to a compatible schema validator.

JSONWay processes JSON and similar data tools in your browser; IP and DNS lookups contact third parties; some tools may save local drafts. Pages load resources and Baidu visit analytics, without sending tool inputs as analytics events. Redact sensitive data and read each tool’s notes.

Common questions

Is JSON the same as a JavaScript object?

JSON is a text format; a JavaScript object is a runtime value. Objects may contain methods or undefined, which strict JSON does not allow. Use a parser such as JSON.parse rather than eval for untrusted data.

Is JSON faster or better than XML?

There is no universal result independent of payload, parser, protocol and document model. JSON often fits ordinary APIs; XML may fit namespaces, mixed content or existing contracts. This guide makes no untested performance ranking.

Does successful formatting prove my data is valid?

It only shows that the parser accepted the syntax. JSON Schema can check required fields, types and ranges. Business rules such as inventory accuracy or authorization remain application concerns.

Can every YAML, XML or CSV file be converted losslessly?

No. YAML tags and aliases, XML attributes and mixed content, and CSV types and nesting need mapping rules. Keep the original and verify fields, arrays and numbers with a small sample first.

Did JSONWay build the open-source projects listed here?

No. These are independent third-party projects linked to their official sources. JSONWay browser tools help with quick inspection and conversion; libraries and CLIs help with integration and automation.

Sources

This guide draws on the following specifications and official project documentation. Examples are original. Sources were checked on November 19, 2026; consult the originals for subsequent changes.

← Back to all tools, including timestamps, text and images