JSON Converter: YAML, XML & CSV

Convert JSON to YAML, XML or CSV 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 or CSV. Then pick the direction, such as JSON to YAML or YAML 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, or the delimiter, header row and quoting for CSV.
  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.

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.