YAML to CSV
Convert a YAML list of mappings to CSV rows. Paste YAML on the left; the CSV output builds on the right as you type.
- id: 1
name: Ada Lovelace
role: engineer
- id: 2
name: Grace Hopper
role: engineer
becomes
id,name,role
1,Ada Lovelace,engineer
2,Grace Hopper,engineer
Each mapping in the top-level sequence becomes a row, and the header row comes from the union of keys across every mapping, the same rule JSON to CSV uses since both go through the same tabular codec.
Flattening
A nested mapping like address: { city: Rome, zip: "00100" } becomes two columns, address.city and address.zip, by default. Turn off Flatten nested if you’d rather keep the nested structure as a JSON string in a single cell, useful when a downstream tool expects to parse that cell back into an object.
Anchors expand into every row
If your YAML uses an anchor to share default values across several list items, <<: *defaults merge keys included, the anchor’s fields expand into each row that references it before the CSV is built. The output has no memory of which rows shared the same anchor; they just look like ordinary duplicated values.
Reordering columns
Column order follows first-seen key order across your YAML list, not a fixed schema. If you need a specific column order in the CSV, reorder the keys in the first mapping of your YAML list, since that’s the one the header takes its order from for any key that first appears there.