CSV to YAML Converter (and XML, TOML)
This csv to yaml converter turns a spreadsheet export into YAML, XML or TOML, and turns those formats back into CSV. It keeps numbers, booleans and empty values typed, and builds nested sections from dotted column names. It all runs in your browser.
- Free to use
- No account required
- Instant results
- Private: runs in your browser
Input
Paste up to 5 MB or open a file up to 50 MB. Converted in your browser; nothing is uploaded.
Options
How nested data maps to a table
- Nested objects become dotted columns: { address: { city: Paris } } ↔ a column
address.city. - Lists of plain values are joined with the list separator: [a, b] ↔ “a|b”. From CSV, name the column
tags[]to split it back into a list. - Lists of objects and nested lists cannot be table cells; they are written as JSON text in one cell, and the result says so.
- Only one list becomes rows (the longest one); other top-level keys are listed as not included.
- XML attributes become plain columns (
id), or@idif a child element has the same name. - CSV has no types: numbers and true/false are written as text, and null as an empty cell. TOML has no null, so empty cells are left out.
Your data: Files and text are processed locally in your browser. Nothing you load here is uploaded to our servers.
How to use
- Pick a direction: CSV → YAML, XML or TOML, or YAML, XML or TOML → CSV.
- Paste the data or open a file of up to 50 MB. A file's type is recognised from its extension or its first characters.
- Set the options: the top-level YAML key, the TOML table name, or the XML root and row element names. You can also choose the list separator, whether types are detected, and whether dotted headers are nested.
- Read the result and the notes underneath, which say what changed or could not be kept.
- Copy the result or download it as
.yaml,.xml,.tomlor.csv.
Examples
Server inventory to YAML (loaded when the page opens). A CSV with the header hostname,ip,port,enabled,location.city,location.rack,tags[],owner,notes becomes:
servers:
- hostname: web-01
ip: 10.0.4.11
port: 443
enabled: true
location:
city: Frankfurt
rack: R12
tags:
- frontend
- public
owner: platform
notes: nullport is a number and enabled a boolean. The empty notes cell is null, and frontend|public became a list because the column is named tags[]. A note with a line break becomes a |- block.
XML back to CSV. A catalogue in which each <book id="bk101" lang="en"> holds <title>, <price> and <author><first>…</first><last>…</last></author> becomes these columns: title, price, author.first, author.last, in_stock, id, lang. The tool reports "Rows were taken from “catalog.book” (2 items)". Midnight & Rain comes out as Midnight & Rain.
TOML release plan to CSV. [[release]] tables with a [release.owner] sub-table become one row per release. features = ["dark mode", "export"] is joined as dark mode|export. The top-level title key is listed as not included, because a CSV holds a single table.
Tips and limits
These are the rules for nested data:
- Nested objects ⇄ dotted columns:
address.city. - Lists of plain values ⇄ one cell joined with the list separator (default
|). From CSV, name the columntags[]to split it again. - Lists of objects or nested lists cannot be cells. They are written as JSON text in one cell, and the notes say so.
- Only the longest list in a document becomes rows; other top-level keys are reported as not included.
- XML attributes become plain columns. A column is called
@idonly if a child element has the same name.
There are a few more points to know:
- CSV has no types. Numbers and true/false are written as text, and null as an empty cell. TOML has no null, so empty cells are left out and counted in the notes.
- YAML anchors, aliases and
<<merge keys are resolved. Documents that use aliases to expand into a huge structure are refused. - Strings such as
yes,on,007or2026-01-01are quoted in YAML, so YAML 1.1 parsers do not turn them into booleans, numbers or dates. - XML root and row names must be legal XML names.
2024 serversis refused with the reason, and headers such asUnit Pricebecome<Unit_Price>. A DOCTYPE in XML input is refused. - Speed in Chrome: 500,000 CSV rows (38 MB) become YAML in about 4 seconds, TOML in about 5 and XML in about 7. Reading YAML back is slower, about 1 second per MB.
FAQ
How do I convert CSV to YAML?
Paste the CSV, keep "CSV → YAML" selected and copy the result. Each row becomes a list item, and each header becomes a key.
What is the difference between YAML and TOML?
Both are readable configuration formats. YAML uses indentation and supports anchors and references. TOML uses `[sections]` and `key = value` lines, has stricter types, and has no null value.
How do I set the XML root element?
Type it in "Root element" (for example `products`), and the name for each row in "Row element" (`product`). Names may not contain spaces or start with a digit.
Can I keep nested data when going back to CSV?
Nested objects become dotted columns, so `address.city` survives the round trip. Lists of objects cannot be table cells and are kept as JSON text.
Why are some of my numbers quoted in the YAML?
Values such as `007` or `12:30` would change meaning if read as numbers, so they stay strings.
Privacy note
Your files are converted in a background thread of your browser tab. Nothing is uploaded, logged or stored. The data is gone when you close or reload the page.
Guides for this tool
Data Cleaning & File ConvertersConvert CSV to YAML for Config or Inventory Files
How to turn a CSV inventory into YAML: the top-level key, tags[] lists, dotted headers for nested keys, and why yes, on and 007 are written in quotes.
4 min read
Data Cleaning & File ConvertersYAML vs TOML vs XML for Config and Data Files
YAML, TOML and XML compared on the same rows: nulls and types, nesting and lists, XML name rules, and what is lost when a config file is converted back to CSV.
4 min read