What YAML to CSV does
YAML to CSV reads YAML and writes it as CSV. The input is parsed first, so a syntax error is reported with its position instead of producing broken output.
YAML to CSV examples
The built-in sample
Input
name: Ada
tags:
- math
- code
address:
city: LondonOutput
name,tags,address.city
Ada,"[""math"",""code""]",LondonThis is the input that the Load sample button fills in.
A mapping becomes one row
Input
version: 1.10
enabled: yes
released: 2024-01-05
base: &b
retries: 3
prod: *b
host: ~
# trailing commentOutput
version,enabled,released,base.retries,prod.retries,host
1.1,yes,2024-01-05T00:00:00.000Z,3,3,A single YAML mapping gives a header and one data row. Nested mappings are flattened to base.retries and prod.retries, and the null host is an empty cell.
Each output was produced by running this tool on the input above it.
How it works
Reading YAML. The input is parsed with js-yaml. Values keep the types YAML assigns them (numbers, booleans, null and timestamps), anchors and aliases are expanded into full copies, and comments are dropped.
Writing CSV. Each object becomes a row. Nested objects are flattened into dotted column names such as address.city, arrays are written as JSON text in one cell, and the header is the union of keys from every row. Values containing commas, quotes or line breaks are quoted, with inner quotes doubled.
Details and limits
- Values are carried across without losing anything in ordinary data; the points above list the cases the two formats handle differently.
- A top-level list of mappings gives one row per mapping; that is the shape that converts best.
- Lists inside a row are written as JSON text in one cell.
- The header is the union of all keys, in first-seen order.
- Input that is not valid YAML stops the tool, and the status line shows where the problem is. The YAML Validator page lists the usual causes.
Questions
Is my data uploaded when I use YAML to CSV?
No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.
What does YAML to CSV do?
YAML to CSV reads YAML and writes it as CSV. The input is parsed first, so a syntax error is reported with its position instead of producing broken output.
Are there any limits I should know about?
A top-level list of mappings gives one row per mapping; that is the shape that converts best. Lists inside a row are written as JSON text in one cell.
Is there a size limit?
There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.
Does it work on phones, and is it free?
Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.