CSV to YAML

Transform data in CSV format to YAML.

About CSV to YAML

Static-site generators, Ansible, Home Assistant and many CLI tools read their data from YAML, while the list you maintain lives in a spreadsheet. This tool converts a CSV into a YAML sequence where each row becomes an item with one key: value line per column, using the header names as keys.

Paste the CSV, click Convert and copy the YAML from the result box. The conversion runs in your browser without uploading anything, so it is safe for configuration data that contains hostnames or internal identifiers.

How to use CSV to YAML step by step

  1. Paste the comma-separated CSV into the left box. The first line must hold the column names, which become the YAML keys.
  2. Click "Convert to YAML". The result appears on the right as a list of items.
  3. Click "Copy" to place the YAML on the clipboard and paste it into your file.

Input and output example

Input

name,age,city
Juan,30,Madrid
Ana,25,Barcelona

Output

-
  name: Juan
  age: 30
  city: Madrid
-
  name: Ana
  age: 25
  city: Barcelona

Why use our CSV to YAML?

Common use cases

Limits and tips

Frequently asked questions

What does the YAML output look like?

A block sequence: each CSV row becomes an item introduced by a dash, and each column becomes an indented key: value line, in the same order as the CSV header. The result is a list of mappings, the most common shape for data files in YAML.

What is the difference between YAML and JSON?

Both represent objects and lists. JSON uses braces, brackets and quotes and is strict and compact, ideal for APIs. YAML relies on indentation, allows comments and needs fewer quotes, which makes it the preferred format for configuration files. Any JSON document is also valid YAML.

Why does my YAML fail to load after conversion?

Most often because a value contains a colon and a space, starts with a special character, or is a string that YAML interprets as another type (yes, no, null, 1e3). Wrap such values in quotes in the YAML, or clean them in the CSV before converting.

Can I convert a semicolon-separated CSV?

Not directly, since only commas are recognised as separators. Convert the file to commas first with the CSV to Delimited tool (from the other direction) or by re-exporting from Excel with comma separators.

Is there a download button?

The result is shown in a text box with a Copy button; paste it into a .yml or .yaml file in your editor. Nothing is uploaded and the conversion happens entirely in your browser.

Related tools

Other free utilities you may find useful

Available languages