CSV to YAML Converter
YAML is what modern config files are made of: Kubernetes manifests, GitHub Actions workflows, Docker Compose, Ansible playbooks, Rails fixtures. This converter reads a CSV and produces a YAML sequence where each row becomes a mapping keyed by the header row. The output uses two-space indentation and a 4-level inline threshold, which matches the style of most editors and linters.
How CSV becomes YAML
-
1
Paste the CSV
A sample is pre-loaded so you can see the default output shape; replace it with your data.
-
2
Choose the delimiter
Comma by default. Enter `\t` for tab-separated input or any other single character your file uses.
-
3
Headers become keys
Row 1 is treated as the header. Data rows become mappings under those keys in the same order as the source columns.
-
4
YAML dumped safely
The output is rendered by the Symfony YAML component, which quotes values when ambiguity with booleans, numbers or dates would otherwise occur.
YAML quirks you should know before pasting the output
YAML is famously forgiving on the surface and full of traps underneath. The dumper handles most of them, but your data still has to survive round-tripping.
The Norway problem and friends
YAML 1.1 treats a bare no, yes, on, off, true, false, y, n (and their capitalised forms) as booleans. Meaning a country code column with NO for Norway can silently turn into false.
| Source cell | Emitted as (unquoted) | Usually intended as |
|---|---|---|
NO |
false |
The country Norway |
ON |
true |
The state Ontario |
123 |
123 |
Either number or ID |
0100 |
64 (octal!) |
A leading-zero code |
The dumper quotes risky values automatically, but if you are seeing wrong types in your output, switch to YAML 1.2 parsers downstream or explicitly quote values you care about.
Formatting choices
- Two-space indentation. Standard for most editors; linters like
yamllintdefault to this. - Inline threshold 4. Deeply nested structures print on one line below the 4th level, above it they expand to multiple lines. Adjust downstream if you want stricter blocks.
- Anchors and aliases are not generated. Each row is a fresh mapping even if rows repeat.
Example output
- name: Alice
age: 30
- name: Bob
age: 25
When to pick YAML over JSON
- Hand-edited configs, where comments and multi-line strings matter.
- Kubernetes manifests, CI pipelines, Ansible plays.
- Any context where people will read the file as much as machines will.
Otherwise JSON is stricter and faster to parse, prefer it for wire formats and generated payloads.
Frequently Asked Questions
YAML 1.1 interprets bare NO as a boolean. The converter quotes risky values, but if a downstream parser still coerces types, quote the problematic cells before pasting the output or switch to a YAML 1.2 parser that treats those as plain strings.
Not with this converter, each row becomes a flat mapping. For nested YAML, build a small script around a YAML library, or convert to JSON first and shape that in a JSON editor.
Cells are parsed with str_getcsv using your chosen delimiter. Quoted values preserve embedded delimiters and quotes the same way they would in a real CSV parser.
Yes. The CSV you paste is sent to our server, because parsing and YAML serialisation run there. It is used only to generate the YAML result and is not stored.
Related Tools
ASCII Table Reference
Full ASCII table from 0 to 127 with decimal, hex, octal, binary, standard names and HTML numeric-reference notation, including NUL, LF and DEL.
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
HEX Color Picker
Pick or enter a HEX colour and get RGB, HSL, approximate CMYK, relative luminance and contrast ratios against white and black.
HTML Character Reference
Searchable list of HTML entities, their named and numeric codes, and a one-click copy for special characters and symbols.
JSON Formatter
Paste JSON to pretty-print with 2 or 4 spaces, minify it to compact output, or run a quick syntax check before copying the result.
Phone Validator
Validate phone numbers by country, detect the region and type, and normalize valid numbers to E.164, international, national and RFC 3966 formats.
Tool available in other languages
- CSV'den YAML'a Dönüştürücü [TR]
- Convertidor de CSV a YAML [ES]
- تحويل CSV إلى YAML [AR]
- Convertisseur CSV en YAML [FR]
- CSV-naar-YAML-converter [NL]
- CSV → YAML 변환기 [KO]
- Konverter CSV ke YAML [ID]
- Chuyển đổi từ CSV sang YAML [VI]
- CSV 转 YAML 转换器 [ZH]
- CSV→YAMLコンバーター [JA]
- เครื่องแปลงข้อมูลจาก CSV เป็น YAML [TH]
- Conversor de CSV para YAML [PT]
- CSV zu YAML Konverter [DE]
- CSV-till-YAML-omvandlare [SV]
- Konwerter CSV na YAML [PL]
- Convertitore da CSV a YAML [IT]
- Конвертер CSV в YAML [RU]