Converters
Converting between data formats is never a pure translation, because no two formats hold the same set of ideas. CSV has no nesting, XML has no arrays, YAML has comments that JSON cannot keep, and TypeScript has types that JSON does not carry.
Every converter here makes those decisions explicitly and reports the ones that applied to your document. A converter that flattens an array into a cell, or drops a column that only appeared in later records, or turns a zip code into a smaller number, should say so. Most do not.
Both directions
Round trips are only lossless within limits, and each page says where its limits are.
JSON and CSV
JSON and YAML
One direction
Which conversion loses what
| Conversion | What does not survive |
|---|---|
| JSON to CSV | Nesting, unless you flatten it. Type information, since CSV has none. |
| CSV to JSON | Nothing, if you keep everything as strings. Turning on type inference is where data gets damaged. |
| YAML to JSON | Comments, permanently. Anchors are expanded inline. Timestamps become strings. |
| XML to JSON | Mixed content ordering, namespaces as namespaces, and the difference between one element and a list of one. |
| JSON to XML | Key names that are not valid XML names get rewritten and will not come back. |
| JSON to TypeScript | Everything at runtime. Types are erased when the code compiles. |