YAML to CSV

Flatten a YAML list into a CSV table.

Reverse
Input
YAML input
Output
Result
Options

Turns { "user": { "name": x } } into a user.name column.

About this tool


This conversion only makes sense for YAML that is already list-shaped: a sequence of mappings that share their keys. A configuration file with a deep, irregular tree has no meaningful table form, so the tool tells you when the structure cannot be tabulated rather than producing something misleading.

The usual source is a YAML data file (fixtures, inventory, a list of hosts) that someone needs to open in a spreadsheet.

How to use it

  1. Paste or upload YAMLDrop a .yaml file onto the input pane, use the file picker, or paste the text directly.
  2. Adjust the options if neededThe defaults suit most input. Open Options to change how values are interpreted or formatted.
  3. ConvertPress Convert to CSV, or use Ctrl+Enter (Cmd+Enter on macOS).
  4. Read any warningsWarnings explain anything that could not be represented exactly in the target format.
  5. Copy or downloadCopy the result, or download it as a .csv file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

YAML to CSV

Input

- id: 1
  name: Alice
  address:
    city: London
- id: 2
  name: Bob
  address:
    city: Paris

Output

id,name,address.city
1,Alice,London
2,Bob,Paris

Each sequence entry becomes a row; the nested address mapping becomes a dotted column.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

The input needs to be a sequence of mappings
A top-level YAML sequence where each entry is a mapping converts cleanly: each entry becomes a row and the union of keys becomes the header. A single mapping produces a one-row file. A deeply nested config with no repeated structure has no table representation and is rejected with an explanation.
Nested mappings become dotted columns
A nested mapping under a key becomes dotted column names, so an address mapping with city and postcode produces address.city and address.postcode. This is lossless for mappings of any depth.
Sequences inside a row become JSON text
A list nested inside a record has no fixed-width column form, so it is written as JSON inside its cell. If you need one row per list item, restructure the YAML before converting.
Types and comments do not survive
CSV cells are untyped text, so booleans and numbers become plain characters and null becomes an empty cell, indistinguishable from an empty string. YAML comments are dropped, as CSV has no place for them.

Limitations


  • Requires a sequence of mappings; arbitrary nested configuration cannot be tabulated.
  • Nested sequences are serialised as JSON text within a cell.
  • Type information and comments are lost.
  • Processing happens in your browser, so very large inputs are bounded by available memory. Files above roughly 10 MB are handled but will feel slower, and multi-hundred-megabyte files are better suited to a command-line tool.

Questions


Why does my config file fail to convert?
Because it is not list-shaped. CSV needs repeated records with shared keys. A configuration tree of unique nested sections has no table equivalent, so the tool explains that rather than inventing one.
What happens to nested lists?
They are written as JSON text inside the cell, since a variable-length list cannot occupy a fixed column.