CSV to YAML Converter

How it works
Indent
Valid CSV

Input CSV

No problems found. This is valid CSV.

About CSV to YAML

Static site generators, Ansible inventories and test fixtures often keep their data in YAML, but the data itself usually starts life in a spreadsheet. This tool turns each CSV row into a YAML mapping, with the header row providing the keys.

The output is a YAML list, one item per row, ready to paste into a _data file or a fixture. Values that YAML would otherwise read as numbers or booleans are quoted, so they stay exactly as they were in the CSV.

How to use it

  1. Paste the CSV, including its header row, into the Input panel.
  2. Choose Convert to YAML as the Output and pick 2 or 4 spaces of indentation.
  3. Copy the YAML or download it as a .yaml file.

Frequently asked questions

Why are some numbers in quotes?

CSV has no types, so every value is treated as text. YAML quotes text that looks like a number or true/false, which keeps a postcode like "01234" from losing its leading zero.

Can I convert tab-separated files?

Yes. The delimiter is detected automatically, so TSV exported from a spreadsheet works the same way as CSV.

Can I go back from YAML to CSV?

Yes. Paste a YAML list of mappings, set the Input to YAML and choose Convert to CSV.

Related tools