Overview
Introduction
Sometimes you have a chunk of YAML, a config snippet, part of a Kubernetes manifest, a CI pipeline's list of steps, and you just want the plain values out of it without parsing the whole document by hand.
This tool reads a flat YAML block sequence and extracts the plain list of items, ready to reuse elsewhere with whichever separator you need.
What Is YAML to List Converter?
The YAML to List Converter is a narrow, purpose-built YAML sequence parser: it reads lines that each start with "- " and extracts the scalar value that follows.
It's not a general YAML parser, it deliberately only understands a flat list of scalars, which keeps its behavior predictable and easy to reason about.
How YAML to List Converter Works
Each non-blank input line is checked for a leading "- " (or a bare "-" for an empty item); anything else is reported as an error naming that exact line.
The remainder of each matching line is unquoted if it's wrapped in single or double quotes, with the standard YAML escape sequences reversed, then the resulting plain values are joined with your chosen output separator.
When To Use YAML to List Converter
Use this when you've copied a YAML list out of a config file and want the plain values as a newline or comma-separated list for use elsewhere.
It's also handy for quickly sanity-checking that a YAML sequence parses the way you expect before committing it to a config file.
Often used alongside List to YAML Converter, List Base64 Decoder and List URL Decoder.
Features
Advantages
- Correctly reverses the quoting and escaping that a real YAML sequence would use.
- Gives a precise, line-specific error instead of failing silently on unsupported YAML.
- Lets you choose how the extracted list is rejoined, newline, comma, or a custom delimiter.
Limitations
- Only handles a flat sequence of scalars, not nested lists, mappings, anchors, or multi-line block scalars (`|` or `>`).
- Doesn't validate the rest of YAML's grammar, it's intentionally narrow rather than a full YAML parser.
Examples
Best Practices & Notes
Best Practices
- If a line fails to parse, check for indentation or a missing "- " prefix, this parser expects each sequence item on its own top-level line.
- Use the comma separator for the output if you're about to paste the result into a comma-separated field.
Developer Notes
Parsing is done with plain string operations: each line is trimmed and matched against a `"- "` prefix, then quoted scalars are unwrapped with `String.prototype.slice()` and `.replace()` reversing the standard YAML escape sequences.
YAML to List Converter Use Cases
- Extracting a plain list of service names from a Kubernetes manifest snippet
- Pulling a list of steps or dependencies out of a CI pipeline YAML file
- Converting a YAML config's array value into a comma-separated list for a spreadsheet
Common Mistakes
- Pasting an indented nested sequence and expecting it to parse, this tool only understands top-level, non-nested items.
- Assuming a YAML mapping (`key: value`) will parse as a list item, it won't, this tool is for sequences only.
Tips
- Strip any surrounding document markers (`---`) or parent keys before pasting, so only the `- item` lines remain.
- Pair with List to YAML Converter to round-trip a list through YAML and back to check the conversion is lossless.