Toolvist

YAML to CSV Converter

Convert YAML lists into CSV or TSV rows, or turn CSV data back into YAML. Free two-way YAML to CSV converter with instant output and no sign-up.

Direction

Rows

0

Columns

0

Root shape

—

Status

—

YAML to CSV Converter

Convert YAML lists into CSV or TSV, and turn CSV data back into YAML. A typical use is moving configuration or fixture data between a YAML file and a spreadsheet without hand-editing.

The format chain continues with the CSV to JSON Converter and the YAML to JSON Converter. To confirm the source parses before conversion, the YAML Validator is the check.

How to use the YAML to CSV

  1. 1 Paste your YAML.
  2. 2 Choose which key names the rows, if it is a list of mappings.
  3. 3 Set the delimiter and whether to include a header.
  4. 4 Download the CSV.

Flattening structured data

CSV is a grid and YAML is a tree, so the conversion is a flattening. A tree can only become a grid if the depth and branching are bounded, and every unbounded aspect has to be either discarded or serialised into a cell.

That is why the shape of the input determines whether the result is usable. A configuration file with two levels of nesting flattens naturally into dotted columns. A document with arbitrary nesting produces something that resembles a spreadsheet but is not really tabular, and the resulting file is usually harder to work with than the original.

  • A list of mappings with consistent keys is the ideal input.
  • Dotted keys preserve nesting in a reversible form.
  • Deeply nested documents do not flatten meaningfully.
  • Check the column count before trusting the result.

How It Works

The YAML parser reads block mappings and sequences by indentation, understands quoted and unquoted scalars, inline [a, b] and {k: v} collections, block scalars (| and >), and comments. Lists of objects become CSV rows with the union of all keys as columns.

  • YAML to CSV and CSV to YAML directions
  • Lists of objects, lists of lists, or single objects
  • Quoted scalars, flow collections and block scalars
  • Configurable delimiter and header
  • Copy or download either format

Frequently asked questions

What YAML shapes convert cleanly to CSV?

A list of mappings with consistent keys, which is the same shape a JSON array of objects has. Anything else — nested structures, scalars at different levels, lists of scalars — requires a flattening decision that will lose information if it is made carelessly.

How are nested keys handled?

By flattening into dotted column names, which preserves the data in a form that can be unflattened. The alternative is to serialise the nested structure into a single cell, which is lossless but not directly usable in a spreadsheet. Which is appropriate depends on what will consume the file.

Why does my output have far more columns than expected?

Because the union of keys across all rows is wider than any single row. If records vary in which fields they carry, the header contains every field any of them has, and each row leaves the others empty. That is correct behaviour for a lossless conversion, though it can produce a sparse file.

Related Developer Tools

Browse all Developer Tools →

You might also need

Tools from other categories that people pair with the YAML to CSV:

Browse the full tool directory →