Skip to main content
Convert2JSON
ConvertersBrowser processing

YAML to CSV Converter

Turn a YAML list into a CSV file you can open in a spreadsheet, with nested values flattened into dotted column names.

Input

YAML
characters
0
lines
0
size
0 B

Options

Needed for Excel to open non-ASCII text correctly.

Your data stays on your device.Parsing, conversion and code generation happen in this browser. Input is not uploaded to Convert2JSON servers.Privacy policy

About this tool

Config and inventory data written as YAML is comfortable to maintain and awkward to review in bulk. Once a list passes a few dozen entries, the question being asked of it is usually a spreadsheet question — sort by this, filter by that, check nothing is missing — and CSV is how you get there.

Records rarely all carry the same keys, so the column set is the union across every record rather than whatever the first one happened to have. A field present in only one entry still gets a column, and the records that lack it get an empty cell instead of a shifted row.

Nested objects are flattened to dotted paths by default, so contact.email becomes its own column. That keeps the relationship visible in the header rather than collapsing it into an unreadable blob.

How to use this tool

  1. Paste a YAML sequence, or upload a .yaml or .yml file.

  2. Choose the delimiter, and whether to flatten nested objects into dotted columns.

  3. Decide how arrays should be handled — joined into one cell, or split across indexed columns.

  4. Press Convert, then download the CSV or copy it into a spreadsheet.

Key features

  • Columns are the union of the keys across every record, not just the first
  • Nested objects flattened into dotted column names
  • Arrays either joined with a separator or expanded into indexed columns
  • Comma, semicolon, tab and pipe delimiters
  • Optional byte order mark so Excel opens UTF-8 correctly
  • Fields quoted only where the delimiter, a quote or a newline requires it

Example

A sequence of mappings

InputYAML

- sku: TENT-2P
  name: Two Person Tent
  quantity: 34
- sku: LAMP-USB
  name: USB Camp Lamp
  quantity: 210

OutputCSV

sku,name,quantity
TENT-2P,Two Person Tent,34
LAMP-USB,USB Camp Lamp,210

Good to know

  • A top-level mapping is not tabular. When the document is a mapping that contains one list, that list is converted — which is the usual API-envelope case, but it does mean the surrounding keys are dropped.
  • Comments are lost, because CSV has nowhere to put them.
  • Deeply nested structures produce a very wide header row. Flattening is honest about the shape rather than hiding it, but the result can still be unwieldy.
  • Excel will reinterpret values that look like dates when opening a CSV. That is Excel, not the conversion — import the file rather than double-clicking it if that matters.

Frequently asked questions

My YAML is a mapping, not a list. What happens?

If the mapping contains exactly one list, that list is treated as the records — the common shape for an API response wrapped in an envelope. Otherwise the mapping is emitted as a single row.

How are nested objects represented?

As dotted column names, so a contact object with an email key becomes a contact.email column. Turn flattening off and nested values are written as compact JSON inside a single cell instead.

What happens to lists inside a record?

By default they are joined into one cell with a separator you can set. Switch to indexed mode and each element gets its own column, such as tags.0 and tags.1.

Why does my spreadsheet mangle non-English characters?

Excel assumes the system codepage unless the file starts with a byte order mark. Turn on the BOM option and it will read the file as UTF-8.

Your data stays on your device

Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.