CSV to YAML Converter
CV-08Paste CSV and get a YAML list with one mapping per row, using the header row as the keys. Values stay text unless you ask for numbers and booleans.
Runs in your browser. Nothing is uploaded.
CSV
YAML
How to use it
- Paste your CSV into the input box, or open a .csv file (up to 5 MB) or drop it on the box.
- Leave Delimiter on Auto, or choose comma, semicolon, tab or pipe. Untick First row is header for a list of lists.
- Tick Convert numbers and true/false if you want YAML numbers and booleans instead of text.
- Copy the YAML or download it as a .yaml file.
What the YAML looks like
The first row becomes the keys, and each later row becomes one item in a YAML list, written in block style: "- id: 1" followed by the other keys of that row. Cells with line breaks are written as block text, and a cell with a comma or other character that YAML could misread is quoted when needed. Blank header names become column_1, column_2, and repeated names get _2, _3. Short rows are padded with empty values. Key order always follows the column order.
Text by default, so nothing gets misread
Every value is text by default. A value such as 007, 2 or yes that a YAML reader might turn into a number or boolean is written in quotes, so it is read back as the same text. With Convert numbers and true/false, whole numbers up to 15 digits, decimals, true and false become YAML numbers and booleans, and empty cells become null. This goes through a JavaScript number, so 1.50 is written as 1.5, while longer integers and values with a leading zero stay text.
What it does not do
It writes plain block YAML with no comments, anchors or custom tags. It does not guess dates, so 2026-01-05 stays text, quoted if a YAML reader would treat it as a date. Without a header row you get a list of lists instead of a list of mappings. The output is generated by the js-yaml library, which loads only when you use this page, and the indent is 2 or 4 spaces.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
A quoted field is never closed (missing closing ") | A field starts with a double quote, but the text ends before the closing quote, so the parser cannot tell where the field stops. | Add the missing closing quote, or double any quote that belongs inside the text, as in "". |
No rows found in the CSV. | The input has no rows after blank lines are removed. | Paste the CSV data. |
Questions people ask
How do I convert CSV to YAML?
Paste the CSV into the input box. The first row becomes the keys and each later row becomes one item in a YAML list. Copy the result or download it as a .yaml file. It runs in your browser, so the data is not uploaded.
Why are my numbers in quotes in the YAML?
By default every value is text, and YAML quotes text that a reader could take for a number, such as 2 or 007. That keeps the value as it was in the CSV. Tick Convert numbers and true/false to get unquoted YAML numbers.
How do I convert CSV to YAML without a header row?
Untick First row is header. You then get a YAML list of lists, one inner list per row, with no keys. With the header option on, a blank header name becomes column_1, column_2 and so on.
What happens to values with commas or line breaks?
A value that contains a comma is read correctly from a quoted CSV field and written as plain YAML text, quoted only if YAML needs it. A value with a line break is written as block text with the line breaks kept.
Are the columns kept in order?
Yes. Keys follow the column order in the CSV, including when the header names look like numbers. Plain JavaScript objects reorder keys that look like integers, so this tool writes each key in turn to keep the order.
Can I use a semicolon or tab separated file?
Yes. Delimiter is on Auto by default and picks comma, tab, semicolon or pipe from the first line. You can also choose one yourself, which is safer when the header line contains quoted commas.
About this tool
The first row becomes the keys and each later row becomes one item in a YAML list. Values stay text by default, so 007 is written as the quoted string '007' and the text yes stays text. With Convert numbers and true/false, whole numbers up to 15 digits, decimals, true and false become YAML numbers and booleans, and empty cells become null; that conversion goes through a JavaScript number, so 1.50 is written as 1.5, while longer integers and values with a leading zero stay text. Strings that YAML would misread are quoted for you, and values with line breaks become block text. Without a header row you get a list of lists. Short rows are padded with empty values; blank header names become column_1, column_2, and repeated names get _2, _3. Comments and anchors are not produced.