YAML to CSV Converter
Convert a YAML block sequence of mappings — a list of objects — into a flat CSV table. Each list item becomes a row, the header row is the union of every item's keys, and nested maps are flattened into dotted columns like address.city. Items that omit a key get an empty cell, so the grid stays rectangular even when records differ. Fields containing the delimiter, quotes, or newlines are quoted per RFC 4180 for clean import into a spreadsheet or database.
How to use the YAML to CSV Converter
Paste a YAML document whose top level is a block sequence — a list where each item starts with - and is a mapping of key: value pairs. The converter reads each list item as one CSV row. The header row is built from the union of all keys across every item, in first-seen order, so a key that appears only in later records still gets a column.
With Flatten nested maps enabled (the default), a nested mapping such as address: with indented city: and zip: children becomes the columns address.city and address.zip. This is what makes a tree-shaped YAML object fit into a flat grid. Choose your Delimiter (comma, semicolon, or tab) and toggle the Header row off if the consumer does not want column names. Every value is CSV-quoted only when it needs to be — if it contains the delimiter, a double quote, or a line break — with embedded quotes doubled. Use Download .csv to save the table.
What is the YAML to CSV Converter?
YAML is a hierarchical format: a value can be a scalar, a list, or another mapping, nested to any depth. CSV is a two-dimensional grid with no nesting. Bridging the two requires flattening — collapsing the YAML tree into a single set of columns. The standard technique is dotted-path keys: a nested mapping at address containing city becomes the single column address.city. Without flattening there is simply nowhere in a CSV to put a sub-object, which is why this conversion only makes sense for a list of records that are mostly flat (or whose nesting is shallow and map-shaped).
The other half of the problem is determining the columns. Unlike a relational table, the objects in a YAML list are not guaranteed to share the same keys — one record might carry an extra field that others omit. The converter therefore takes the union of all keys seen across the whole list and uses that as the header, filling missing cells with empty strings so the output is rectangular. Key order follows first appearance, which keeps the columns stable and predictable rather than alphabetised.
A subtlety worth knowing: nested lists inside a record do not flatten cleanly into columns the way nested maps do, because a list has no key names to append. When a value is a sequence, this tool serialises it into the cell as a compact bracketed string rather than inventing positional columns, which keeps the header stable. Output quoting follows RFC 4180: a field is wrapped in double quotes only when it contains the delimiter, a double quote, or a newline, and embedded quotes are escaped by doubling. If you would rather keep the data hierarchical, convert to JSON with the YAML to JSON converter instead.
Common use cases
- Config-to-spreadsheet review — flatten a YAML list of services, users, or feature flags into a CSV stakeholders can open in Excel.
- Bulk data entry round-trips — export YAML records to CSV, edit them in a spreadsheet, then convert back.
- Loading YAML data into a database — produce a delimited file from YAML to feed an import or
COPYcommand. - Comparing environments — turn per-environment YAML lists into CSVs and diff them column-by-column.
- Reporting from CI/infra manifests — flatten lists of jobs or resources for ad-hoc analysis and pivot tables.
- Documentation tables — generate a tidy CSV (then a Markdown table) from a YAML inventory of API endpoints or settings.