Boneyard Tools

YAML to CSV Converter

Paste a YAML list of records and get a spreadsheet-ready CSV as you type. The header row is the union of every record's keys, so rows with different fields still line up, and any nested mapping or list is written into its cell as compact JSON. Pick the delimiter you need, then copy the CSV or download it as data.csv, all without your data leaving the browser.

How to convert YAML to CSV

  1. Paste your YAML list of records into the YAML input box, or click Load sample to see the shape.
  2. Check the CSV output box below, which updates live as you edit.
  3. Open the Delimiter menu and choose Comma, Semicolon, Tab or Pipe.
  4. Click Copy to grab the CSV, or Download to save it as data.csv.

Examples

A list of records with matching keys

- name: Ada
  role: Engineer
  age: 36
- name: Linus
  role: Maintainer
  age: 54
name,role,age
Ada,Engineer,36
Linus,Maintainer,54

Records with different fields

- name: Ada
  age: 36
- name: Linus
  city: Portland
name,age,city
Ada,36,
Linus,,Portland

A single mapping becomes one row

name: Ada
role: Engineer
name,role
Ada,Engineer

Frequently asked questions

Is my YAML uploaded anywhere?

No. The conversion runs entirely in your browser with js-yaml and PapaParse, so your YAML never leaves your device and nothing is stored on a server.

What YAML shape works best?

A sequence of mappings, where each list item is a record with roughly the same keys. A single mapping also works and becomes one CSV row. A bare scalar like a lone number or string is rejected because it has no columns to build.

How are the CSV columns chosen?

The header is the union of keys across every record, in the order they first appear. Records that are missing a column get an empty cell, so heterogeneous data still aligns under the right headers.

What happens to nested objects and lists?

CSV cells hold flat text, so any nested mapping or array is written as compact JSON inside its cell, such as {"city":"Portland"}. Top-level scalars like strings, numbers and booleans stay as plain values.

Which delimiters can I use?

Comma, semicolon, tab or pipe, chosen from the Delimiter menu. Any field that contains the delimiter, a quote or a line break is wrapped in quotes automatically so the file stays valid.

Why does the output use \r\n line endings?

Rows are separated by a carriage return and line feed, the line ending the CSV standard recommends and that Excel expects. Most spreadsheet apps and parsers read it without any trouble.

What if a list item is not an object?

If a top-level array item is a scalar or a nested list, it is placed under a single value column so nothing is lost. Mixing objects and loose values in one list is allowed but usually means the source YAML needs tidying.

Why am I getting an error?

The input must be valid YAML that describes a list of objects or a single object. A syntax slip, wrong indentation, or a top-level value that is only a number or string will be rejected with a short message.

Can I convert the CSV back to YAML later?

Not with this tool, which only goes one way. To move in the other direction, or to reshape data, pair it with the related JSON and CSV converters listed below.

Learn more

Related tools