JSONConverter
โ† Back to the tools
๐Ÿ“‹

Data Format Cheat Sheet

Four text formats, one data model. This cheat sheet shows how the same data looks in JSON, CSV, YAML and XML, and which conversions are lossless.

The same record in four formats

JSON{"name":"Alice","age":30,"tags":["a","b"]}
CSVname,age,tags\nAlice,30,"a,b"
YAMLname: Alice\nage: 30\ntags:\n - a\n - b
XMLAlice30ab

Type handling

JSONNumbers, booleans, null, strings, arrays, objects โ€” all native
CSVEverything is text; conversion coerces obvious numbers/booleans, keeps "007" as a string
YAMLNumbers/booleans/null resolve; 1.1 words like yes/on stay strings
XMLElement text coerces to numbers/booleans; attributes stay strings; no null (โ†’ empty)

Nesting

JSONArbitrary depth with {} and []
CSVFlat, two-dimensional only
YAMLArbitrary depth via indentation
XMLArbitrary depth via elements

Quoting & escaping

JSONDouble quotes, \\ escapes, no literal newlines in strings
CSVFields with commas/quotes/newlines are quoted; "" escapes a quote
YAMLQuotes optional; single/double/literal-block scalars
XML< > & entities; CDATA for raw text

Lossless round-trips

JSON โ‡„ YAMLAlways lossless (same data model)
JSON โ‡„ CSVLossless for flat arrays of objects with coercible values
JSON โ‡„ XMLLossless except null โ†’ empty string
XML โ‡„ YAMLVia JSON; watch attribute/text naming conventions
Try the interactive converter