CSV to YAML Converter
Turn spreadsheet rows into clean YAML lists with typed scalars, safe quoting and optional nested keys. Nothing leaves your browser.
CSV input
YAML output
0 rows · 0 columnsPaste CSV or upload a file to generate YAML
Each row becomes one YAML mapping. Results update as you type.
Details
CSV to YAML Converter parses RFC 4180 CSV — quoted fields, doubled quotes, embedded newlines, BOM and comma/semicolon/tab/pipe delimiters — and emits a YAML list of mappings. The header row becomes keys; each data row becomes one list item. Smart typing converts numbers, booleans and empty cells to YAML scalars, while values that could be misread (leading zeros, yes/no/on/off, indicator characters, colons, quotes) are double-quoted using YAML 1.2 core-schema rules. Dotted headers can be expanded into nested mappings, and keys can be sanitized for config files. Choose block or flow style, preview the output and download a .yaml file; nothing is uploaded.
More examples
Fixture list from a spreadsheet
id,name,active,score
1,Ann,true,9.5
2,Ben,false,7Two rows become two YAML mappings: numbers and booleans are typed, text stays plain, and each mapping starts with '- ' on its first key.
Nested config keys
env.name,env.region,replicas
prod,us-east-1,3With nested keys enabled, env.name and env.region become an env mapping with two children, while replicas stays a top-level key.
Strings that look like numbers
zip,code,status
01234,007,yes
90210,042,noLeading zeros are quoted to avoid octal interpretation, and the YAML 1.1 words yes/no are quoted so they remain strings.
Examples
Typed fixture list
id,name,active,score
1,Ann,true,9.5
2,Ben,false,7- id: 1
name: Ann
active: true
score: 9.5
- id: 2
name: Ben
active: false
score: 7Numbers and booleans are emitted as YAML scalars; strings stay unquoted unless a quoting rule applies.
Nested config from dotted headers
env.name,env.region,replicas
prod,us-east-1,3- env:
name: prod
region: us-east-1
replicas: 3Nested keys mode groups dotted headers into a mapping; the following top-level key aligns with the '- ' marker.
Dangerous strings stay strings
zip,code,status
01234,007,yes- zip: "01234"
code: "007"
status: "yes"Leading zeros and the YAML 1.1 word yes are double-quoted, so the value survives a round trip as text.
About this tool
The CSV to YAML Converter turns spreadsheet rows into a YAML list of mappings: the first row supplies the keys, and every following row becomes one list item. That is the shape Kubernetes fixtures, Ansible inventories, translation tables and config seeds expect. Writing it by hand means fighting indentation after every column change; this tool produces the whole list in one pass and updates while you type.
Parsing follows RFC 4180. Quoted fields, doubled quotes, embedded newlines and a leading BOM are handled, and the delimiter (comma, semicolon, tab or pipe) is detected from the first records unless you choose one explicitly. Header-less files get generated column_1…column_N keys, duplicate headers are renamed with a warning, and short rows are padded with null instead of silently shifting columns.
Scalar output follows the YAML 1.2 core schema. In Smart types mode, ordinary numbers, true/false and empty cells become native YAML scalars; strings such as 01234, yes or no are quoted so a downstream parser cannot reinterpret them. All strings mode keeps every cell textual, Quote everything mode quotes even simple text, and the nested-keys option expands dotted headers such as env.region into nested mappings. A flat key always wins when it collides with a nested path, and the collision is reported.
Everything runs locally in the browser. The output panel shows a preview, row/column/byte statistics, and warnings for repaired input; you can copy the YAML or download data.yaml. No CSV is uploaded, logged or sent to a service.
What this tool does not do
- Input is capped at about 5 MB and 50,000 data rows; larger files should be split before conversion.
- The emitter writes lists of mappings only; it does not produce anchors, tags, multi-document streams or arbitrary YAML expressions.
- Nested-key expansion splits on dots and does not interpret quoted or escaped dots inside header names.
How to use this tool
Load the CSV
Paste CSV into the input panel, upload a .csv/.tsv file, or click one of the example chips. The delimiter is detected automatically; override it if a file uses an unusual separator.
Choose scalar and key options
Smart types infers numbers, booleans and nulls. Switch to All strings or Quote everything when the consumer needs text only. Turn on Nested keys for dotted headers, and Sanitize keys to turn names like 'price (USD)' into config-friendly identifiers.
Pick block or flow style
Block list is the default and the most readable for config files. Flow list puts each row on one line as '- {key: value, ...}', which is handy for compact fixtures.
Review and download
Read the warnings for renamed or padded columns, check the preview and the stats, then copy the YAML or download data.yaml.
Use cases
Generating Kubernetes fixtures
Export a sheet of deployments with dotted headers, turn on nested keys, and paste the resulting YAML list into a fixture or seed file.
Building translation tables
Localization teams keep strings in spreadsheets; converting key/locale columns to a YAML list gives a config file that apps can load directly.
Creating Ansible inventory data
Asset inventories with host, region and port columns become typed YAML mappings ready for playbooks, without hand-fixing indentation.
Seeding test databases
A small CSV of sample rows converts to a YAML fixture list in the browser, including explicit nulls for missing optional fields.
Output rules at a glance
| Input / setting | YAML output and rule |
|---|---|
| id,name → 1,Ann | - id: 1 / name: Ann — header names become keys; each row starts with '- ' on its first key |
| true / false / empty | true / false / null — Smart typing emits YAML 1.2 core-schema scalars |
| 01234 / 007 | "01234" / "007" — leading zeros are quoted to prevent octal interpretation |
| yes / no / on / off | "yes" / "no" — YAML 1.1 booleans are quoted so they stay strings |
| env.name | env: {name: ...} — with nested keys enabled, dotted headers become mappings |
| Quoted CSV fields | Commas and doubled quotes are parsed per RFC 4180, then quoted only when YAML needs it |
Indentation is two spaces. Block-style nested children are indented four spaces under the list marker so the mapping aligns with the first key.
Common mistakes
Mistake:Assuming yes/no will be read as strings.
Fix:YAML 1.1 parsers treat yes, no, on and off as booleans. This converter quotes them, but if you paste YAML into another tool that rewrites it, verify that the quotes survived.
Mistake:Using a flat header and a dotted header that share a prefix.
Fix:With nested keys on, headers 'env' and 'env.name' collide. The flat scalar key wins and a warning explains the drop; rename one header to keep both values.
Mistake:Forgetting that a header-less file generates column_N keys.
Fix:Switch off 'First row is header' only when every row is data. Otherwise your first record becomes key names and disappears from the output.
Mistake:Assuming all numbers are safe to emit bare.
Fix:Values with leading zeros can be read as octal and very long integers can lose precision in some parsers. Smart typing quotes leading zeros but cannot preserve arbitrary-precision arithmetic downstream.
Frequently asked questions
What does the CSV to YAML Converter produce?
A YAML list of mappings. The header row becomes the key names, and each data row becomes one list item that starts with '- '. This is the shape used by Kubernetes fixtures, translation tables and many config seed files. Block style keeps each mapping on several readable lines; flow style puts each row on one line as '- {key: value}'.
Why is my number quoted in the YAML output?
Values with leading zeros such as 01234 or 007 are quoted so a YAML parser cannot reinterpret them as octal numbers. Smart types mode otherwise emits ordinary numbers as bare YAML scalars. If you want every cell quoted, choose Quote everything; if you want no inference at all, choose All strings.
How does the tool handle YAML 1.1 words like yes and no?
Under YAML 1.1, yes, no, on and off are booleans, which surprises people whose CSV contains text values. The converter quotes those words so they stay strings under both YAML 1.1 and 1.2, while true and false are emitted as real booleans in Smart types mode. Null, tilde and empty cells become YAML null.
Can I turn dotted headers into nested YAML mappings?
Yes. Enable Nested keys and headers like env.name and env.region become an env mapping with name and region children. Two spaces indent keys, and four spaces indent children under the list marker. If a flat header such as env also exists, the flat key wins and a warning tells you the nested path was dropped.
What happens with semicolon, tab or pipe separated files?
The delimiter is detected from the first ten records by counting separators outside quoted fields, so comma, semicolon, tab and pipe files all work. You can override detection with the Delimiter selector. Quoted commas and doubled quotes inside cells are parsed according to RFC 4180.
Is my spreadsheet data uploaded anywhere?
No. Parsing, typing, quoting and download all happen in your browser tab. The file never leaves your device, nothing is logged, and the page keeps working if you disconnect from the network after loading it.
References & standards
Related tools
Base32 Encoder / Decoder
Encode and decode Base32 (RFC 4648) with hex input mode and Crockford variant. Handles TOTP secrets. Runs in-browser.
Base58 Encoder / Decoder
Convert hex or text to Base58 and back, with Base58Check validation (version byte + checksum). IPFS CIDs too. In-browser.
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
BibTeX to JSON Converter
Parse .bib bibliographies into structured JSON with authors, months, macros and LaTeX cleanup, all in-browser.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV Data Viewer
Paste CSV and inspect it as a sortable, searchable table with delimiter detection and inline export.