TXT · Text & Data tools

CSV to YAML Converter

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

CSV to YAML

Convert CSV rows to a YAML list of mappings. Paste CSV on the left; the YAML output builds on the right as you type.

id,name,role
1,Ada Lovelace,engineer
2,Grace Hopper,engineer

becomes

- id: 1
  name: Ada Lovelace
  role: engineer
- id: 2
  name: Grace Hopper
  role: engineer

The header row supplies the keys, and each remaining CSV row becomes one item in the YAML sequence. id comes out as the plain number 1, not a quoted string, because Coerce types is on by default.

Type coercion into YAML

With Coerce types on, a cell reading 42, true, false, or null becomes that YAML type, written bare with no quotes. Anything else stays a quoted or plain string depending on what the YAML serializer decides it needs. This matters for downstream tools that check types strictly, a boolean field read as the string "true" behaves differently from the real boolean true in most YAML-consuming code.

Delimiter and header detection

Auto-detect scores comma, semicolon, tab, and pipe against your file’s first rows and picks whichever gives the most consistent column count, so most real CSV and semicolon-delimited exports convert correctly without touching the Delimiter control. Header row assumes your first line is column names; turn it off for headerless data and each row becomes a plain YAML list instead of a mapping.

After the conversion

If the resulting YAML needs cleanup, comment annotations, or key reordering, the YAML formatter validates and reformats it in place without touching the CSV source.

Frequently Asked Questions

One item in a top-level YAML sequence, a mapping keyed by the header row's column names.

Turn on Coerce types. A cell reading 42 becomes the number 42 in the YAML, written without quotes; with it off, every cell stays a quoted string regardless of what it looks like.

Auto-detect usually catches it by checking which delimiter produces the most consistent column count across your rows. Set Delimiter to Semicolon directly if you want to be certain.

Turn off Header row and each CSV row becomes a YAML list of plain values instead of a mapping, useful for simple tabular data with no natural column names.

Block style, one key per line with dash-prefixed list items, which is the more common style for hand-edited YAML and the easiest to read in a diff.

Jump straight to a conversion

Full Data Format Converter tool

Explore Our Tools

Browse all tools