CSV to YAML

Convert CSV rows into a YAML list, using the header row as keys — handy for fixtures, Ansible variables or static-site data files. Quoted fields and commas inside values are handled. Runs in your browser.

Suggested tools

YAML to CSV

Convert a YAML list into CSV.

YAMLCSV
Open Tool

XML to CSV

Turn list-style XML into a CSV table, one row per record.

XMLCSV
Open Tool

CSV to XML

Convert CSV rows into well-formed XML elements.

CSVXML
Open Tool

CSV to HTML

Convert CSV into an HTML table.

CSVHTML
Open Tool

CSV Escape / Unescape

Quote a value correctly for CSV, or unwrap a quoted CSV field.

CSV
Open Tool

JSON to YAML

Convert JSON into readable YAML.

JSONYAML
Open Tool

About CSV to YAML

CSV to YAML converts rows of a spreadsheet into a YAML list, using the header row as the keys of each item. It is handy for test fixtures, Ansible or Kubernetes variables, static-site generators (Jekyll, Hugo) and any config that is easier to keep in YAML than in a spreadsheet.

Quoted fields, commas inside values and line breaks are parsed correctly, and the YAML is written with standard two-space indentation without wrapping long lines. Everything runs locally in your browser — the text you paste is never uploaded.

How to use CSV to YAML

  1. Paste CSV with a header row, or upload a .csv file.
  2. Press Convert.
  3. Copy or download the YAML list.

Key features

  • Header row becomes the keys of every item
  • RFC-4180 CSV parsing (quotes, commas, line breaks)
  • Two-space indentation, no line wrapping
  • Reverse conversion available with YAML to CSV

Example

Codes such as 007 are kept as text.

Input
id,name,code
1,Asha,007
2,Ravi,042
Output
- id: '1'
  name: Asha
  code: '007'
- id: '2'
  name: Ravi
  code: '042'

When to use CSV to YAML

  • Creating data files for Jekyll, Hugo or other static-site generators.
  • Turning a spreadsheet of hosts or users into Ansible variables.
  • Generating YAML test fixtures from a CSV export.

Tips and common problems

  • Every value is kept as text; change types by hand if your tool needs numbers.
  • Use simple header names without spaces — they become YAML keys.
  • Comma, semicolon and tab separators are detected automatically.

Frequently asked questions

Every cell is kept as text, exactly as it appears in the CSV, so codes such as 007 or phone numbers never lose digits. Number-like values are quoted in the YAML ('42') to show they are text.