Conversion Map
JSON → CSV
The most common conversion. Works best with flat arrays of objects that share the same keys.
Input JSON
[ { "name": "Alice", "age": 28, "city": "SF" }, { "name": "Bob", "age": 34, "city": "NYC" }]Output CSV
name,age,cityAlice,28,SFBob,34,NYCEdge Cases to Watch
| Problem | Solution |
|---|---|
| Nested objects | Flatten first: user.address.city → separate column |
| Arrays in values | Join with separator: ["a","b"] → "a;b" |
| Missing keys | Fill with empty string or null |
| Commas in values | Quote the field: "San Francisco, CA" |
| Unicode characters | Use UTF-8 BOM for Excel compatibility |
Use Our Tool
JSON → XML
JSON and XML have fundamentally different data models. Key decisions during conversion:
| JSON Concept | XML Mapping | Example |
|---|---|---|
| Object key | Element name | "name": "Alice" → <name>Alice</name> |
| Array | Repeated elements | ["a","b"] → <item>a</item><item>b</item> |
| null | Empty element or attribute | null → <value xsi:nil="true"/> |
| Number/Boolean | Text content | 42 → <age>42</age> (type info lost) |
1<!-- Input: {"user": {"name": "Alice", "roles": ["admin", "editor"]}} -->2<root>3 <user>4 <name>Alice</name>5 <roles>6 <item>admin</item>7 <item>editor</item>8 </roles>9 </user>10</root>Data Loss Risk
42 and "42" both become <value>42</value>. Round-tripping is not guaranteed.JSON → YAML
The most straightforward conversion — JSON is valid YAML, so the mapping is almost 1:1.
JSON
{ "server": { "host": "0.0.0.0", "port": 3000, "debug": false }}YAML
server: host: "0.0.0.0" port: 3000 debug: falseYAML Auto-Type Pitfall
on/off/yes/no as booleans, 3.10 as float 3.1. Always quote ambiguous strings when converting.JSON → Markdown
Converting JSON to Markdown is useful for documentation, README files, and reports.
1| name | age | city |2|-------|-----|------|3| Alice | 28 | SF |4| Bob | 34 | NYC |Reverse Conversions
CSV → JSON
Each CSV row becomes a JSON object. The header row provides the keys. Handle type inference carefully — everything in CSV is a string by default.
1// Raw CSV parse: { "age": "28", "active": "true" }2// With type inference: { "age": 28, "active": true }3// Rule: parse numbers, booleans, and null; keep everything else as stringXML → JSON
The hardest reverse conversion. Decisions: should XML attributes become properties? Should text nodes be extracted? How to handle namespaces?
Try These Tools
JSON to CSV
Convert JSON arrays to CSV with flattening
Open toolCSV to JSON
Import CSV data into JSON with type inference
Open toolJSON to XML
Convert JSON to well-formed XML
Open toolJSON to YAML
Convert JSON to clean YAML
Open toolJSON to Markdown
Export JSON as Markdown tables
Open toolJSON to Text
Convert JSON to readable plain text
Open toolConversion Best Practices
Try It Yourself
Here's a JSON array. Think about how this would map to CSV columns, XML elements, and YAML structure.
Try It Yourself
Validate this JSON, then try our converter tools above