Skip to content
BENIBIX Learn

JSON vs XML

Both hold data as plain text. JSON uses names and curly brackets; XML wraps each value in tags, which makes it longer.

Development📄 Files & Formats

JavaScript Object Notation (JSON)

A plain text format for data, made of names and values. Most APIs use it.

JSON is a plain text way to write down data so programs can swap it. It uses names and values in curly brackets, like "age": 36. It can hold text, numbers, true or false, null, lists and nested groups. Almost every language can read and write it. Most web APIs send and receive their data as JSON.

Example
Jack's app asks a weather API for London. The reply is JSON with the temperature, the wind and the chance of rain.
Why it matters
JSON is the common language of the web. If two programs talk, it is very likely in JSON.
Full entry
Development📄 Files & Formats

Extensible Markup Language (XML)

A text format that wraps data in named tags. Wordy, but still common in older systems.

XML is a text format that wraps each piece of data in named tags. A tag looks like <name>Emma</name>, and tags can sit inside other tags. It is wordier than JSON, because every tag is written twice. It is still used in office files, RSS feeds, Android layouts and many older business systems. HTML looks similar, but HTML is for pages and XML is for data.

Example
A bank in Zurich sends its daily payment file to another bank as XML. Each payment sits inside its own set of tags.
Why it matters
Lots of systems still speak XML. You will meet it in files, feeds and older APIs.
Full entry

In one line

JavaScript Object Notation (JSON)
A plain text format for data, made of names and values. Most APIs use it.
Extensible Markup Language (XML)
A text format that wraps data in named tags. Wordy, but still common in older systems.