JSON

JSON ↔ YAML / CSV / XML / TOML

Convert JSON to YAML, CSV, XML, or TOML and back — entirely in the browser, no libraries.


                    

JSON, YAML, CSV, XML, and TOML all solve the same problem — structured data representation — with different syntax and different trade-offs. This tool converts between all of them in both directions, right in your browser.

How to use it

Common uses

Things to keep in mind

JSON ↔ YAML and JSON ↔ TOML are usually lossless in both directions, since both formats support nesting the same way JSON does.

JSON → CSV loses nested structure: CSV is a flat tabular format, so nested objects and arrays either need to be flattened into separate columns or serialized as text.

Article about this tool: JSON ↔ YAML/CSV/XML/TOML: when and why to convert

Frequently asked questions

Why does converting to CSV sometimes lose structure?

CSV is inherently a flat, tabular format, so nested objects or arrays cannot be represented directly — they need to be flattened into simple "key: value" pairs first.

How does the tool decide what becomes an XML attribute versus an element?

By convention: keys prefixed with "@" become attributes (for example, @id becomes the id attribute), and the "#text" key is used for mixed-content text. This is this tool's own convention, not a universal XML standard.

Is data sent to a server during conversion?

No, converting to and from YAML, CSV, XML, and TOML happens entirely in your browser via JavaScript, with no external libraries and no server.

Why does a number or string sometimes change after converting to YAML?

A YAML parser tries to guess the type of an unquoted value: "1.20" can become the number 1.2 (losing the trailing zero), and "NO" can become the boolean false under the older YAML 1.1 rules. To avoid this, explicitly quote values that need to stay strings.

Can I convert back and forth without losing data?

JSON ↔ YAML and JSON ↔ TOML are usually lossless in both directions, since both formats support nesting the same way JSON does. JSON → CSV → JSON loses any nested structure that was there — converting back only returns the flat version of the data.

Articles: JSON