What the JSON converter does
JSON is the lingua franca of APIs, but the data often has to end up somewhere else: a YAML config file, an XML feed or SOAP body, or a CSV for a spreadsheet. This tool takes JSON and converts it to YAML, XML or CSV, in your browser, with the output ready to copy or save. It complements the JSON Tools page (format, validate, tree view) by handling the format-to-format step.
The same data in each format
JSON
{ "users": [ { "id": 1, "name": "Ana", "admin": true }, { "id": 2, "name": "Kit", "admin": false } ] }
YAML
users:
- id: 1
name: Ana
admin: true
- id: 2
name: Kit
admin: false
XML
<root><users><id>1</id><name>Ana</name><admin>true</admin></users><users><id>2</id><name>Kit</name><admin>false</admin></users></root>
CSV (of the users array)
id,name,admin
1,Ana,true
2,Kit,falseConversion rules
| Target | How JSON maps | Watch for |
|---|---|---|
| YAML | Objects → mappings, arrays → lists, scalars as-is; strings that look like numbers, booleans or dates are quoted | Very deep nesting becomes hard to read; comments cannot be generated from JSON |
| XML | Keys → element names, arrays → repeated elements, a root element wraps everything | Keys with spaces or starting with digits are sanitised; attributes are not produced (everything becomes an element) |
| CSV | An array of flat objects → one row per object, keys as headers; nested values are stringified | Only tabular data converts cleanly; a single object becomes one row; mixed keys produce empty cells |
Getting good CSV
- Point the converter at the array you want as rows. If the array is nested (
data.results), paste that sub-array rather than the whole response. - Flatten nested objects first if the spreadsheet needs separate columns:
address.cityrather than a JSON blob in one cell. - Values containing commas, quotes or line breaks are quoted per RFC 4180 and open correctly in Excel, Numbers and Google Sheets.
- Save with a
.csvextension; Excel may need “Data → From Text/CSV” for UTF-8 with non-Latin characters.
When to use which format
- YAML — configuration read by humans: CI pipelines, Kubernetes, Docker Compose, Ansible. Comments and multi-line strings make it friendlier than JSON.
- XML — legacy and enterprise integrations, SOAP, RSS/Atom, sitemaps, document formats, systems that require schema validation.
- CSV — spreadsheets, bulk imports, data analysis, anything tabular.
- JSON — stays the right choice for APIs and anything a program reads.
Round trips are lossy
JSON, YAML and XML are not equivalent. JSON has no comments, XML has attributes and mixed content that JSON cannot express, YAML has anchors and several string styles. Converting JSON → XML → JSON generally works; XML → JSON → XML may lose attributes and ordering. CSV loses all structure beyond rows and columns. Keep the original file whenever the data will need to go back.