Data Converter Privacy: local processing only
Convert between JSON, CSV, XML, and YAML. Handles nested data, flattening, XML attributes, type inference, and format-specific options.
How It Works
What the Data Converter Does
This tool converts structured data between JSON, CSV, XML, and YAML β all within your browser. Paste data, pick source and target formats, and get a properly converted result with explicit handling of nested objects, arrays, attributes, and types.
Why JSON, CSV, XML, and YAML Don't Map Perfectly
JSON supports nested objects and arrays at any depth. CSV is flat: each row has the same columns. XML has elements, attributes, text nodes, and namespaces. YAML adds comments, anchors, and aliases. Converting between these formats requires trade-offs β and this tool makes those trade-offs visible.
Nested JSON and CSV Flattening
When converting JSON to CSV, nested objects are flattened using dot notation by default: subscription.plan, subscription.cost. Arrays are JSON-stringified into cells unless you choose "expand to columns" or "join with separator". This prevents the notorious [object Object] problem.
XML Attributes, Text Nodes, and Repeated Elements
When converting XML to JSON, attributes use the @ prefix (e.g., @id), text content uses #text when mixed with attributes, and repeated child elements become arrays. When converting JSON to XML, keys starting with @ become attributes, and arrays become repeated elements.
YAML Anchors, Aliases, and Comments
YAML comments cannot be preserved in JSON β they have no JSON equivalent. YAML anchors and aliases are expanded during parsing. A warning is shown when comments or anchors are detected, so you know what won't round-trip.
Type Inference and Safe Conversion
In "Safe" mode, obvious numbers, booleans, and null values are converted. Values with leading zeros (like ZIP codes 08001) and large integers beyond safe limits are preserved as strings. Set type inference to "Off" to keep all values as strings.
Lossy Conversion Warnings
When a conversion cannot preserve all information perfectly, a lossiness report appears. For example: "Nested objects were flattened using dot notation" or "YAML comments are not preserved in JSON". No data is silently dropped.
Privacy and Local Processing
All conversion happens locally in JavaScript. Your data never leaves your browser. There are no server requests during conversion, no analytics on content, no storage of your data. Verify in DevTools β Network tab.
FAQ
Is my data uploaded?
Why did nested JSON become multiple CSV columns?
user.name) to preserve data without losing structure. You can switch to "JSON-stringify" in options to keep nested values as JSON strings in cells instead.Why did an array become a JSON string inside a CSV cell?
Can I convert CSV back to nested JSON?
user.name will create nested objects.How are XML attributes represented in JSON?
@ prefix: <user id="1"> becomes {"@id": 1}. Text content uses #text when mixed with attributes or child elements.