TXT · Text & Data tools

YAML to CSV Converter

Input · YAML
Output · CSV
0 Bin0 Bout0lines in0keysEmptyYAML
Go to the full Data Format Converter

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.

Frequently Asked Questions

A top-level sequence of mappings, YAML's version of an array of objects, works best. Each mapping becomes one row, and the header row is the union of every key seen, in first-seen order.

They flatten into dotted column names, the same as JSON to CSV: a nested address: { city: Rome } becomes a column named address.city. Turn off Flatten nested to keep the nested value as a single JSON-encoded cell instead.

Yes. An anchor referenced elsewhere with an alias resolves to its full value during parsing, so every row that uses the alias gets the complete data, not a reference.

Yes, it becomes one row, with the header taken from that mapping's own keys.

The header includes every key seen across all mappings. A mapping that's missing one of those keys gets a blank cell there instead of shifting the other columns.

Jump straight to a conversion

Full Data Format Converter tool

Explore Our Tools

Browse all tools