Paste CSV or open a .csv file and get clean YAML: each row becomes a mapping in a list, header cells become keys, and numbers, true/false and empty cells are typed the way you choose. Strings that YAML would misread, like no, 0755 or 2024-01-15, are quoted for you.
Last updated:
Your CSV is converted in this tab and never uploaded. Tip: drop a file on the input box, or press Ctrl + Enter to convert.
Advertisement
Advertisement
How to use the CSV to YAML Converter
Paste your CSV into the left box, or open or drop a .csv/.tsv file. A sample loads so you can see the result right away.
Check the delimiter and header settings. Auto-detect picks the separator that splits the rows most consistently.
Choose how values are typed: detect numbers and booleans, keep zip codes like 00501 as text, and pick what empty cells become.
Pick an output shape, such as a list of mappings for Ansible vars or a mapping keyed by ID for config lookups.
Copy or download the YAML. It updates as you type or change an option.
becomes, as a list of mappings with type detection and dot nesting:
- id: 1
name: Ada Lovelace
active: true
zip: '00501'
address:
city: London
- id: 2
name: Alan Turing
active: false
zip: 10001
address:
city: Manchester
The zip code 00501 is quoted so it keeps its leading zeros, while 10001 is a real number. Choose Mapping keyed by first column instead and the rows are indexed by ID ("1":, "2":), which is convenient for lookups in config files.
Values YAML can misread, and how they are written
CSV cell
Unquoted YAML would read it as
Written as
no, yes, on, off
Boolean (YAML 1.1 parsers such as PyYAML)
'no'
0755, 0x1F, 1e3
Number (octal, hex, scientific)
'0755' (kept as text)
2024-01-15
Date / timestamp
'2024-01-15'
12:30
Base-60 number 750 in YAML 1.1
'12:30'
#general
A comment (the value disappears)
'#general'
key: value inside a cell
A nested mapping, or a syntax error
'key: value'
Empty cell
null
null, "" or omitted (your choice)
Text over two lines
Needs block or escaped style
|- block literal
Tips
Ansible and Helm values: use a root key (for example users) so the list can be referenced as a variable or under a chart value.
Exporting from Excel or Google Sheets: save as CSV UTF-8 so accented characters survive. Semicolon-separated exports from European locales are detected automatically.
Each data row becomes a mapping whose keys are the header cells, and all rows together form a sequence (a list), written with a dash before each item. A header id,name and a row 1,Ada becomes - id: 1 followed by an indented name: Ada line.
Why are some values wrapped in quotes?
YAML gives unquoted text a type. Words like yes, no, on and off become booleans in YAML 1.1 parsers, 1e3 and 0x1F become numbers, 2024-01-15 can become a date and a value starting with # becomes a comment. The converter quotes such strings so they stay exactly as they were in the CSV; with type inference on, only real numbers, true/false and null are left unquoted on purpose.
What happens to leading zeros like 00501 or 007?
With Keep leading zeros as text checked, they are written as quoted strings, so zip codes, product codes and phone numbers keep every digit. Uncheck it to turn them into plain numbers (501 and 7).
How are empty cells converted?
You choose: null (the YAML null value), an empty string written as two quotes, or leaving the key out of that row entirely. Leaving it out is handy when the YAML feeds a tool that applies its own defaults for missing keys.
Can I create nested YAML from a flat CSV?
Yes. Check Nest keys with dots and name columns like address.city and address.country; they become an address mapping with city and country inside it. If a column clashes with a nested one, it is kept as a flat key and a note explains why.
What if my CSV has no header row?
Uncheck First row is the header. Every row is then converted and the keys are named column_1, column_2 and so on, which you can rename afterwards.
Is my data uploaded?
No. Parsing and conversion happen in JavaScript inside your browser tab, so the CSV never leaves your device. It also works offline once the page has loaded.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.