CSV ↔ YAML Converter Online
Convert CSV data to YAML and YAML lists back to CSV instantly in your browser.
When a CSV ↔ YAML converter is the right tool
Use this page to move a headered table between CSV and a YAML list of objects. That is a common shape for fixture data, simple config lists, and spreadsheet exports that need to live in a YAML file. Choose a direction, paste the source, and click Convert. The result does not update as you type.
The CSV reader here understands quoted commas, and CSV → YAML infers booleans, nulls, and numbers. That is different from CSV ↔ JSON, which splits on every comma and keeps every cell as a string. If you want JSON rather than YAML, use that page — or convert to YAML here and then use JSON ↔ YAML.
Use cases
Turning a spreadsheet export into a YAML list
Leave the direction on CSV → YAML, paste a header row and the rows beneath it, and Convert. Load Sample uses a short name, age, city, and active table. Ages become numbers and true / false become booleans.
Turning a YAML list of objects back into CSV
Switch to YAML → CSV and paste a sequence of mappings. Keys that appear only on later rows are still included — the header is the union of every object’s keys. A YAML file whose root is a mapping, not a list, is rejected with “YAML input must be a sequence (list) of objects.”
A quoted city or an empty cell
A field such as "New York, NY" stays one city on this page. An empty CSV cell becomes YAML null. Going back, a missing key or a YAML null becomes an empty cell.
How conversion works
CSV → YAML trims the text, drops empty lines, takes the first line as headers, and parses later lines with a quoted-comma splitter. Each cell is trimmed and passed through a small type guess, then the array is dumped with js-yaml. YAML → CSV loads one document with js-yaml, requires an array, unions the keys, and writes a comma-separated table with quoting when a cell needs it. Switching direction clears both editors. There is no Swap button and no indent control.
name,age,city,active
Alice,30,New York,true
Bob,25,London,false
- name: Alice
age: 30
city: New York
active: true
- name: Bob
age: 25
city: London
active: falseage is the number 30, not the string "30", and active is a boolean. That is expected on this converter.
sku,code
widget,030
- sku: widget
code: 30If you need to keep the leading zero, this type guess will not help — the value has already become 30. The same Number parse will also turn a bare 1.0 into 1.
What this tool does not do
It does not convert a YAML mapping at the root, a multi-document stream, or nested objects into useful CSV cells. It does not keep comments. It does not update live, and it does not upload anything. For column statistics on the CSV side, use CSV Column Stats. To pretty-print the YAML afterwards, use YAML Formatter.
How to use CSV ↔ YAML Converter
- Choose CSV → YAML or YAML → CSV. Switching tabs clears the input.
- Paste the source, or use Load Sample for a short example in the current direction.
- Click Convert, then Copy when the output looks right.
- Use Clear to empty both editors.
Frequently asked questions
How does CSV → YAML work?
The first line is the header. Later lines become a YAML sequence of mappings. Empty lines are dropped. Each cell is trimmed, then typed: the exact text true or false becomes a boolean, null or an empty cell becomes null, and a value that parses as a JavaScript Number becomes a number. Anything else stays a string. The YAML is written with js-yaml at indent 2 and no line wrapping.
How does YAML → CSV work?
The input must be a single YAML document that is a sequence of objects. A mapping, a scalar, or a multi-document stream is rejected. Column names are the union of keys from every object, in the order those keys first appear. Missing keys become empty cells. Nested objects are written as the string [object Object]. An empty list produces empty output. Cells that contain a comma, a quote, or a newline are quoted, and quotes inside a cell are doubled.
Does the CSV side understand quoted commas?
Yes. Unlike the CSV ↔ JSON page, this reader keeps a comma inside double quotes in the same field, and it treats a doubled quote as a literal quote. The parse is still line-based, so a quoted field that contains a newline will split. Tabs and semicolons are not treated as delimiters.
How exact is the type inference?
true and false are matched exactly after trim, so True stays a string. A leading-zero value such as 030 becomes the number 30. Dates that js-yaml parses as Date objects are written to CSV with the host locale’s Date.toString(), not as ISO-8601. YAML comments are dropped on load.
Do the results update as I type? Is there a Swap button?
No. You have to click Convert. Switching CSV → YAML or YAML → CSV clears the input and the output. There is no Swap control. Load Sample pastes a short name/age/city/active example for the current direction and clears the output.
Is my data sent to a server?
No. Conversion runs in your browser with js-yaml. Closing the tab discards what you pasted. Do not paste tables that contain personal data or secrets if you would not be comfortable with them sitting in memory on this device.