JSON Converter: YAML, XML, CSV & TOON

Convert JSON to YAML, XML, CSV, TSV or TOON and back again, with indent, sorting, delimiter and type options.

Free tools that run in your browser. Nothing you type, open or create is uploaded to NerdBible or anyone else.

YAML

Converted in your browser with js-yaml (MIT licence). YAML comments, anchors and custom tags have no JSON equivalent, so comments are dropped and anchors are written out in full. A YAML file with several documents separated by --- becomes a JSON array.

How to use it

  1. Pick the format: YAML, XML, CSV, TSV or TOON. Then pick the direction, such as JSON to YAML or TOON to JSON.
  2. Paste your data. The result updates as you type, and an error shows its line and column.
  3. Set the options: indent and key order for YAML, the declaration and value types for XML, the delimiter, header row and quoting for CSV and TSV, or the delimiter and indent for TOON.
  4. Copy or download the result, or press Swap to convert it back.

Questions

Is my data uploaded?

No. Every conversion runs in your browser and nothing is sent, which matters for configuration files that hold hostnames or keys and for customer exports.

Is every JSON file valid YAML?

Almost. YAML 1.2 was designed as a superset of JSON, so JSON can be read as YAML. Converting to proper YAML style just makes it shorter and easier to read.

Why did a value like no or 1.10 change in YAML?

YAML guesses types for unquoted values. This converter follows YAML 1.2, where only true and false are booleans, but tools built on the older YAML 1.1 read yes and no as booleans too. Quote values you need kept as text.

How are XML attributes and repeated elements shown in JSON?

Attributes become keys that start with @, so id="b1" becomes "@id": "b1", and text next to attributes goes under #text. Two or more child elements with the same name become a JSON array. XML has no data types, so tick the option to read numbers and true or false as real values.

Why does Excel put my CSV in one column?

Excel in many European languages expects semicolons, because the comma is the decimal separator there. Choose Semicolon as the delimiter, or import the file with Data, From Text.

What is TOON?

Token-Oriented Object Notation, a text format that holds the same data as JSON in fewer characters, made for sending structured data to large language models. Nesting is shown by indentation, short lists sit on one line (tags[3]: a,b,c), and a list of objects with the same keys becomes a table with the keys written once in a header. Converting JSON to TOON and back gives the same data.

Which parts of TOON does this converter support?

Objects, nested objects, inline lists of plain values, tabular arrays with a {field} header, list items written with a hyphen (including objects and lists inside lists), the [N] length on every array, quoted strings with the five standard escapes, and comma, tab and pipe delimiters. When reading, the older [#N] length marker is accepted too. Strict mode reports an array whose rows do not match its declared length; turn it off to read what is there. Unusual layouts that the specification leaves open, such as a tabular array as the first field of a list item, are read leniently by indentation, so check those results.

Is TSV different from CSV?

Only in the separator: TSV puts a tab between fields, so commas inside values need no quotes. Spreadsheets paste TSV straight into separate columns. The TSV tab uses the same rules as CSV for headers, nesting and value types.

How are nested objects handled in CSV?

They are flattened into columns with dot keys, such as address.city and tags.0, and every key found in any row becomes a column. Converting the CSV back with dot keys turned on rebuilds the nesting.

About this tool

About the JSON converter

Data moves between formats constantly: a Kubernetes file in YAML, an old integration that speaks XML, a spreadsheet that wants CSV or TSV, a prompt that needs compact TOON. This converter handles all of them in both directions, updating as you type and pointing to the line and column of any error. Press Swap to convert a result straight back.

YAML

Set the indent and whether keys are sorted. The converter follows YAML 1.2, where only true and false are booleans. Tools built on the older YAML 1.1 read yes and no as booleans too, so quote values that must stay text. YAML comments have no JSON equivalent and are dropped, and anchors are written out in full.

XML

  • Keys starting with @ become attributes, so id='b1' maps to '@id'.
  • Text next to attributes goes under #text.
  • Repeated elements become a JSON array.
  • XML has no data types, so tick the option to read numbers and true or false as real JSON values.

CSV

Nested objects are flattened into columns with dot keys such as address.city, and converting back with dot keys on rebuilds the nesting. Every key found in any row becomes a column. If Excel puts everything in one column, choose a semicolon delimiter, which many European versions of Excel expect.

TSV

The TSV tab is the CSV converter with a tab between fields, the format spreadsheets use when you copy and paste cells. Commas inside values need no quotes, and the file downloads as .tsv.

TOON

TOON, Token-Oriented Object Notation, holds the same data as JSON in fewer characters, which helps when sending structured data to a large language model. Nesting is shown by indentation, lists of plain values sit on one line, and a list of objects with the same keys becomes a table with the keys written once, such as users[2]{id,name}: followed by one row per user. The converter follows the public specification: the [N] length on every array, quoting rules, list items and comma, tab or pipe delimiters, and it shows how much shorter the TOON is than minified JSON.

Every conversion runs in your browser, which matters for configuration files that hold hostnames or keys and for customer exports.

Related tools