JSON StudioGuidesMore toolsFeature requestsδΈ­ζ–‡

Convert JSON to CSV, YAML, TOML and XML: formats and limitations

Choose a format based on the receiving system: CSV for flat tables, YAML or TOML for configuration, and XML for element-based documents. These formats represent data differently, so a successful conversion does not always mean a lossless round trip.

Open this tool β†’

How to use the tool

  1. Select a source format and a target format. JSON can convert to each supported format; other formats convert back to JSON.
  2. Paste or import input, or load a format-specific example.
  3. Convert and review any format limitation reported in the error message.
  4. Copy or download the result. Swap direction to load the generated result as the next input and test the reverse conversion.

An example to test

CSV input:
name,age
Alex,28
Sam,32

JSON β†’ XML input:
{"root":{"name":"Alex","active":true}}

CSV and TOML constraints

CSV export requires a non-empty array of flat objects or one flat object. Nested fields are rejected rather than silently flattened. Null becomes an empty cell. CSV import keeps text by default; number and boolean inference is optional. TOML requires an object root and cannot represent null.

XML roots, attributes and text

JSON-to-XML input needs one root key such as root. Use @_ for attributes and #text for text. XML import keeps scalar text as strings. Null and a single-item array cannot always retain their JSON meaning. DTD and entity declarations are not supported.

Frequently asked questions

Why does JSON-to-XML require a root key?

XML needs a single root element. Wrap sibling JSON fields in one object, for example {"root":{"name":"Alex","age":28}}.

Why did a CSV number become a string?

CSV stores cells as text. Enable number and boolean inference only when converting numeric-looking identifiers will not lose their intended representation.

Related guides