How to use CSV to YAML
- Paste your CSV into the Input box, or click Open a file to load a .csv file.
- Set the Delimiter (Auto-detect, Comma, Semicolon or Tab) and the Indentation (2 or 4 spaces).
- Keep First row is the header ticked to get keys, or untick it to get a list of lists. Untick Detect numbers, true/false and null to keep every value as text.
- Check the YAML in the Output box and the "N row(s), M column(s)" line, then click Copy or Download to save data.yaml.
Features
- Turns each CSV row into a YAML mapping, using the header row as keys
- Auto-detects the comma, semicolon or tab delimiter, or lets you choose it
- Reads quoted fields with commas, quotes and line breaks as described in RFC 4180
- Converts numbers, true, false and null only when they are written exactly, so 007 and 1e3 stay text
- Renames a repeated header with the suffix _2 and gives an empty header the name columnN
- Runs in your browser, so the CSV is never uploaded
Supported formats and limits
- Maximum input: 10,000,000 characters
Examples
| Input | Result |
|---|---|
| name,age,active Ana,30,true "Luis, Jr.",41,false | - name: Ana age: 30 active: true - name: Luis, Jr. age: 41 active: false — The quoted field keeps its comma, and 30, 41, true and false are written as numbers and booleans. |
| code,qty 007,1e3 | - code: "007" qty: "1e3" — 007 and 1e3 are not written as canonical numbers, so they stay text and YAML quotes them. |
| a,b 1,2 | - a: "1" b: "2" — With Detect numbers, true/false and null unticked, every value is text. |
Limitations
- A CSV that has only a header row produces an empty list, [].
- Only exact lowercase true, false and null are converted; True or NULL stay text.
- Numbers are converted only in canonical form, such as 42 or -3.5. Values with leading zeros, exponents or thousands separators stay text.
- Every value ends up as a plain scalar. The tool cannot create nested YAML from flat CSV.
- Very large files can be slow to process in the browser.
Learn more
CSV is a flat table, while YAML is a structured, human-readable format used for configuration files, test fixtures and data in static site generators. Converting between them is common when a spreadsheet export has to become seed data or a config list.
The mapping is direct. The first row names the keys, and every following row becomes one mapping in a YAML sequence. The quoting rules of CSV, defined in RFC 4180, decide where a field starts and ends: a field in double quotes may contain the delimiter, a line break or a doubled quote.
Types are the delicate part. CSV has no types, but unquoted YAML scalars do: 30 is a number, true is a boolean and null is empty. The converter detects only unambiguous forms, so an identifier such as 007, a ZIP code or a version like 1e3 is not silently changed into another value. When you need every value as text, untick the detection option.
Frequently asked questions
How is a CSV row turned into YAML?
With the header row on, each row becomes a mapping whose keys are the column names, and the rows form a YAML list. With it off, each row becomes a list of values.
Why are some values in quotes in the YAML?
YAML would read a bare 007 or 1e3 differently from the original text, so the converter quotes values that must stay text. If you switch off number detection, every value is quoted for the same reason.
What happens to duplicate or empty column names?
A repeated header gets the suffix _2, _3 and so on, and an empty header is named column followed by its position, such as column3.
Does it work with semicolon-separated files from Excel?
Yes. Auto-detect picks the semicolon or tab delimiter, or you can set the Delimiter yourself.
Is my CSV uploaded?
No. The conversion runs in your browser.
Sources
Last reviewed: September 30, 2026