YAML to CSV Converter
Convert array-shaped YAML into CSV, and CSV back into YAML, bidirectionally, with dot-notation flattening and type inference.
Related Tools
Learn more about the YAML to CSV Converter
YAML to CSV and CSV to YAML, One Tool
YAML represents data as nested maps and lists, which is flexible but not tabular. CSV (Comma-Separated Values) represents data as flat rows and columns — the format every spreadsheet tool, BI platform, and bulk-import feature understands. Converting YAML → CSV means turning a YAML list of maps at the root into a table: each item becomes a row, and each key becomes a column. Nested maps are flattened into dot-notation column names automatically, so a city key inside an address map becomes an address.city column.
CSV → YAML runs the same idea in reverse: each row becomes one item in a YAML list, with column headers as keys. Type inference is on by default, so values like 42, true, and empty cells become real numbers, booleans, and nulls in the output instead of quoted strings — turn it off to keep every value as plain text.
This page converts entirely in your browser. Paste YAML or CSV — or drag and drop a .yaml/.yml or .csv file — and the conversion runs instantly as you type. Nothing is uploaded to a server.
Why Convert Between YAML and CSV?
Turn a YAML List Into a Spreadsheet
Inventories, user lists, and Ansible variable files are often a YAML list of maps at the root — a natural fit for rows and columns once flattened.
Hand-Edit Config Data in a Spreadsheet
Non-developers can open, filter, and edit a CSV in Excel or Google Sheets far more easily than a YAML file, then convert it back for the app to consume.
Round Out the YAML Converter Set
This sits alongside the YAML ↔ JSON converter, extending the same CSV workflow already available for JSON to YAML-based data lists.
Handling Real-World, Uneven Data
Not every item has every key. Missing keys become blank CSV cells instead of breaking the conversion, so partial or inconsistent records still produce a usable file.
Example
Notice how address becomes two flattened columns, the missing address.zip and tags for Alan Turing are left blank, and the comma and quotes in row three are escaped correctly.
- id: 1
name: Ada Lovelace
address:
city: London
zip: SW1
tags: [math, pioneer]
- id: 2
name: Alan Turing
address:
city: Manchester
- id: 3
name: "Grace \"Amazing\" Hopper"
address:
city: New York, NY
zip: "10001"id,name,address.city,address.zip,tags
1,Ada Lovelace,London,SW1,"[""math"",""pioneer""]"
2,Alan Turing,Manchester,,
3,"Grace ""Amazing"" Hopper","New York, NY",10001,Going the other way, this same CSV converts back into a YAML list of maps with types inferred from each cell:
id,name,city,zip,active
1,Ada Lovelace,"London, UK",SW1,true
2,"Grace ""Amazing"" Hopper",New York,10001,false
3,Alan Turing,Manchester,0161,Features
Bidirectional Conversion
Convert YAML to CSV or CSV to YAML from the same page — just switch direction.
Nested Key Flattening
Nested maps become dot-notation columns automatically — address.city, address.zip — on YAML → CSV.
RFC 4180 Escaping
Values containing commas, quotes, or line breaks are quoted and escaped correctly on the way to CSV.
Type Inference on CSV → YAML
Numbers, booleans, and empty cells become real YAML values instead of quoted strings — turn it off to keep everything as text.
Upload a File
Drag and drop or upload a .yaml/.yml or .csv file depending on the direction.
Copy / Download Output
Copy the result or download it as a standalone .csv or .yaml file.
How to use
Paste your input in the left editor. The output appears automatically on the right. Use the toolbar buttons to copy, download, or transform the result.
- Paste or type your content in the input editor on the left.
- The formatted output is generated automatically.
- Use Copy, Download, or other actions from the output toolbar.
- Click the expand icon to view the output in fullscreen.
FAQ
Is this YAML/CSV converter free?
Yes, the converter is completely free to use with no limits, signup, or account required.
Is my data uploaded to a server?
No. All conversion happens entirely in your browser using JavaScript. Your YAML and CSV are never uploaded or sent to a server.
What kind of YAML can I convert to CSV?
The YAML root must be a list of maps, e.g. "- id: 1\n name: Ada". Each item in the list becomes one row in the resulting CSV.
How are nested keys handled on YAML → CSV?
Nested maps are flattened into dot-notation columns automatically. A field like address.city in the CSV header corresponds to the city key inside an address map in the YAML.
What happens if the YAML root is a single mapping, not a list?
The tool shows a clear error explaining that the root must be a list of maps, rather than silently producing a one-row or broken CSV.
What does type inference do on CSV → YAML?
With it on, values like 42, true, false, and empty cells become real YAML numbers, booleans, and nulls instead of strings. Numbers with a significant leading zero (like a postcode fragment) are kept as strings so the zero isn’t lost. Turn it off to keep every value as plain text.
How does it handle commas and quotes inside values?
The CSV output follows RFC 4180: any value containing a comma, quote, or line break is wrapped in quotes, with internal quotes doubled, so the file opens correctly in Excel or Google Sheets. CSV input is parsed the same way.
Can I upload a file instead of pasting?
Yes. Drag and drop or use the upload button to load a .yaml/.yml file (when converting YAML → CSV) or a .csv file (when converting CSV → YAML).
Can I download the converted output?
Yes, use the Download button to save the result as a standalone .csv or .yaml file.
