YAML to CSV Converter
Example
Input:
- name: Ali age: 30 - name: Sara age: 25
Output:
name,age Ali,30 Sara,25
About this converter
The inverse trip of CSV-to-YAML: YAML seed data and fixtures often need to land in a spreadsheet. The converter requires the shape that honestly maps to a table — a top-level list of flat objects — and builds columns as the union of keys, so items with extra fields extend the table instead of losing data, and items missing a field get an empty cell. A value that is itself a list or object cannot be a CSV cell in any truthful way, so it is written as compact JSON text in the cell, visible and recoverable, rather than stringified into "[object Object]" garbage the way naive converters do it.
Frequently Asked Questions
Why must the YAML be a list?
A CSV is rows and columns; only a list of objects has rows. A single mapping converts better via YAML to JSON, then JSON to CSV tools.
What happens to nested values?
They are written as JSON text inside the cell — preserved, visible, and parseable later.