CSV to YAML Converter

Turns CSV rows into a YAML list of records on this page.

Use this tool

Input CSV format

Parsed table

Result

The result appears in this panel after you run the tool.

About this tool

With Header row on, each later row becomes a record named by the first row. With it off, the result is a list of lists. Values stay strings.

How to use it

  1. Paste a table or open a file.
  2. Leave Header row on for a list of records. Turn it off for a list of lists.
  3. Use Convert.

Limitations

Strings under keys, or a sequence of sequences

The delimiter is replaced by indentation, and the values stay strings

The input dialect splits cells. When the header control is on, each data row becomes a mapping. Keys are the header strings. Values are the cell strings, including digits that look numeric. YAML will not treat them as numbers unless some later load decides to, and a quoted digit in the dump may or may not be quoted depending on the dumper. When the header control is off, the dump is a sequence of sequences, not a set of mappings named c1 and c2. That naming is the XML path. Here a headerless file stays positional.

Duplicate header names collapse to the last column before the dump. The earlier text is dropped. Extra cells beyond the header are dropped. Short rows leave empty strings. None of those losses is marked in the YAML. Comments cannot appear, because a CSV cell is not a comment syntax the dumper will emit as a comment. A cell with a line break becomes a multiline scalar in whatever style the dumper picks.

Default wrapping

This dump uses the library’s default line width. A long cell can be folded across lines with a folded-scalar marker. Reloading joins the text back, but the file you see is not one physical line per field. The JSON-to-YAML direction on the other page disables wrapping. This page does not. Indentation is two spaces by that default. It is not a copy of the CSV separator, and it is not configurable here as two versus four.

No nesting will appear

A dotted header is a single key that contains a dot, not a nested mapping. If you needed role.title to become a role mapping, this page will not split on the dot. The flattener used in the opposite direction creates those dots from real nesting. Feeding its CSV back here does not rebuild the nesting. Use this page for a flat table you want to read as YAML. Edit the YAML if you need true structure.

Privacy

Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.