CSV to YAML
Paste CSV with a header row and get a tidy YAML list of objects, converted live in your browser.
Example
Given this CSV:
name,age,active
Ada,36,true
Linus,29,false
You get this YAML:
- name: Ada
age: 36
active: true
- name: Linus
age: 29
active: false
How it works
The tool parses CSV (handling quoted fields, commas, and escaped quotes), treats the first row as keys, and builds an array of objects which is serialized to YAML with js-yaml. Numbers and booleans are inferred automatically.
Good to know
CSV to YAML turns a comma-separated table into a YAML sequence of mappings, using your first row as the field names. It's aimed at developers and DevOps engineers who keep configuration, fixtures, or seed data in spreadsheets but need it in YAML for tools like Kubernetes, Ansible, GitHub Actions, Docker Compose, or static-site front matter. Because everything runs in your browser, you can paste internal data (user lists, environment maps, inventory) without it ever leaving your machine.
Reach for it whenever someone hands you a CSV export and the target system wants YAML, or when you'd rather edit tabular data in a spreadsheet and convert it at the end. Typical jobs include building a values file for a Helm chart, generating test fixtures, or filling a list of objects in an Ansible vars file. The conversion happens live as you type, so you can tweak a header or a cell and watch the output update.
Read the output as an array: each non-header row becomes one - key: value block, and every column header becomes a key inside it. The tool infers types, so a cell reading 42 emerges as a YAML number, true/false become booleans, blank cells become null, and everything else stays a string. The status line reports how many rows were converted, which is a quick sanity check against your expected row count.
One caveat worth knowing: type inference is automatic and not optional, so values like a leading-zero ZIP code (01234), a phone number, or a version string that looks numeric may be coerced into a number and lose formatting. If you need those preserved exactly, wrap the cell in double quotes in your CSV so it is treated as a string. Duplicate or empty header names are also auto-renamed (for example to column1 or name_1) to keep the YAML keys unique.
Frequently asked questions
How does it handle commas or quotes inside a field?
Wrap the field in double quotes, e.g. "Engineer, Lead". Escape a literal double quote by doubling it (""). The parser respects quoted fields so embedded commas and newlines stay intact.
Are numbers and booleans kept as strings?
No. Values that look like numbers (42, 3.14) become YAML numbers, and true/false become booleans. Empty cells become null. Anything else stays a string.
Is my data uploaded anywhere?
No — this tool runs entirely in your browser. Your input never leaves your device and it works offline once loaded.
Is it free?
Yes, completely free with no sign-up and no limits.
People also ask
What is the difference between CSV and YAML?
CSV is a flat, tabular format where each line is a row and commas separate columns, best for spreadsheet-like data. YAML is a hierarchical format that supports nested structures, typed values (numbers, booleans, null), lists, and mappings, making it common for configuration files.
Can I convert CSV to YAML without the first row being a header?
This tool always treats the first row as the keys for every object it produces. If your CSV has no header, add a header line with your desired field names before pasting, otherwise your first data row will be consumed as the keys.
Why did my ZIP code or phone number lose its leading zero in the YAML?
The converter infers types, so a cell that looks like a number is output as a YAML number and leading zeros are dropped. To keep the original text, wrap that value in double quotes in your CSV so it is treated as a string.
Does the converter support multi-line values inside a cell?
Yes. Newlines inside a field are preserved as long as the field is wrapped in double quotes, because the parser only ends a row at a newline that falls outside of quotes.
How are empty cells converted to YAML?
An empty cell becomes null in the YAML output. A cell containing only spaces is preserved as its literal text rather than being treated as empty.
Can I convert the resulting YAML back into JSON?
YAML produced here is standard and can be parsed by any YAML library and then serialized to JSON. CalcCafe also offers related developer converters such as YAML to JSON Schema for working between formats.
Is there a row limit for converting CSV to YAML?
There is no fixed limit imposed by the tool; it processes whatever you paste entirely in your browser. Very large inputs are bounded only by your device's available memory and browser performance.
What happens if two columns have the same header name?
Duplicate headers are automatically made unique by appending a suffix, such as turning a second name column into name_1. Empty header cells are renamed to a generated key like column2 so no data is dropped.
Related tools