CSV to YAML
Turn a CSV table into a YAML list; each row becomes a record, each header a key, and values like 02134 stay intact
Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.
Did this tool do the job?
Thanks, your feedback came through.
How it works
You usually need this when a table has to become a config file: a server list, test data, translation keys or an Ansible inventory lives in a spreadsheet, but the program expects YAML. Save the sheet as CSV, open the file in Notepad or TextEdit, copy the text and paste it into the left pane; the YAML appears on the right right away. The first line is the header and each header becomes a key. A "name,role,port" header with three rows under it gives a list of three items: "- name: web-1", then "role: frontend" and "port: 8080" below it. The separator is detected from the first rows, so a comma file from English Excel and a semicolon file from European Excel both work; a quoted cell such as "cache, redis" stays one value. With "Detect them", 8080 is written as a number and true or false as a boolean. A ZIP code like 02134, an amount like 1.234 or 1,250 whose meaning depends on the region, and an ID longer than 15 digits stay text and get double quotes, so the program that reads the YAML does not turn them into numbers. An empty header becomes "column3" and a repeated one "name_2"; the result line lists what changed. Copy the output or download it as data.yaml.
This tool is also known as csv to yaml, csv to yaml converter, convert csv to yaml, csv to yml, excel to yaml.
What is YAML?
YAML is a text format that writes data with indentation and colons: "port: 8080" is a key and its value, a leading "- " marks a list item, and nesting is built with spaces only (tabs are not allowed). Docker Compose, Kubernetes, GitHub Actions and Ansible files are YAML. Because the reader guesses the type of unquoted values, quoting matters for data coming from a table; this tool quotes every text value that could be guessed wrong.
What is CSV?
CSV is a plain-text table: each line is a record and a separator splits it into fields. Excel, Google Sheets and most admin panels export it. The separator depends on the region: English Excel uses a comma, Excel in comma-decimal regions a semicolon. A cell that contains the separator is wrapped in double quotes. CSV has no types; every cell is text and the program reading it decides what it is.
What is the difference between CSV and YAML?
CSV is a flat table: every row has the same columns, there is no room for nested data or lists, and cells have no type. YAML is a tree: a record can hold another record, a list or multi-line text, and numbers, booleans and text are separate types. That is why going from CSV to YAML means deciding types, and going back means flattening nesting into column names such as address.city. Use CSV when people will edit the table and YAML when a program reads it as settings.
YAML's silent type guessing: why some values come out quoted
YAML guesses the type of any value written without quotes. "port: 8080" is read as a number and "active: true" as a boolean. Written bare, "zip: 02134" may be read as the number 2134 (some parsers even treat a leading zero as octal), "country: NO" (Norway) becomes false in older YAML 1.1 parsers, and "date: 2026-09-27" turns into a date object. When this tool keeps a value as text and that value looks like a number, a date or a yes/no word, it writes it in double quotes. The file then gives the same value whether PyYAML, Ruby or Go reads it.
Number detection is narrow on purpose: 34, -3, 12.5 and 1,25 have only one meaning, so they become numbers (1,25 is written as 1.25). 1,250 is one thousand two hundred fifty in the US but 1.25 in much of Europe, and 1.234 has the same problem the other way round; since the tool cannot know where the file was saved, both stay text. Values with a leading zero, such as 007 or a ZIP code, also stay text, because the zero is information and a number would lose it.
- 8080 → port: 8080 (number)
- true / FALSE → true / false (boolean)
- 02134 → "02134" (leading zero kept)
- 1,250 or 1.234 → quoted text (thousands or decimal is unclear)
- empty cell → "" (empty text, not null)
Which setting to use when
If the output goes into a program's configuration (Docker Compose, Kubernetes, Ansible, an app's settings file), keep "Detect them": a port number and an on/off flag must be a real number and a real boolean, or the program may reject the text "8080". If you are carrying translation strings, product codes or anything that must stay exactly as typed, choose "Keep everything as text"; nothing is then turned into a number or boolean, and values that look like one (8080, true) are quoted so the reading program keeps them as text too.
Set the separator by hand only when detection gets it wrong. If the result line shows fewer fields than you expect (1 field for a 5-column table, say), the file probably uses semicolons and another character is more frequent in the first rows. For the reverse direction use the YAML to CSV tool: a list made here comes back with the same columns there. Only decimal-comma values such as 1,25 come back as 1.25, because they were turned into numbers; with "Keep everything as text" every cell returns unchanged.
Frequently asked questions
How do I convert a CSV file to YAML?
Open the CSV file in Notepad, TextEdit or any text editor, copy its contents and paste them into the left pane on this page. The first line is taken as the header; each data row becomes an item starting with "- " in a YAML list, and each header becomes a key of that item. Copy the result from the right pane or download it as a .yaml file.
Why is my ZIP code 02134 written in quotes?
Without quotes, a program reading the YAML could take it for a number and strip the leading zero. The tool recognizes the value as text and writes it in double quotes, so it stays 02134 no matter which program reads the file. The same rule applies to ambiguous amounts such as 1,250, to long ID numbers and to yes/no-like words such as NO, on or yes.
All my data lands in one field. Why?
The separator was probably not the one detection picked. Excel in many European and Latin American regions saves CSV with semicolons, English Excel with commas. Open "Column separator" and pick the one your file uses; the setting is right when the field count in the result line matches the number of columns in your table.
Is my data sent to a server?
No. Reading the CSV and writing the YAML both happen inside your browser. Even if you paste server addresses, passwords or a customer list, the text never leaves this page and is not saved anywhere.