Convert a list to YAML

Paste one item per line and get a YAML sequence back: `- value` on each line. Values containing YAML-reserved characters or leading/trailing whitespace are auto-quoted so the output always parses cleanly. Blank lines are dropped. Runs in your browser.

Input
Ready
Output
Live

A YAML sequence generator

This tool emits a YAML block sequence - a flat list where every non-blank input line becomes `- value`. There is no mapping (key/value) support, no nesting, no anchors, no flow style. If you need those, you probably want to write YAML directly. This is for the common case where your source is a plain list and the consumer is a YAML-reading config file, fixture, or API.

Quoting is automatic. A value is wrapped in double quotes when it contains any character that would confuse a YAML parser: `:` (mapping delimiter), `#` (comment), `[`, `]`, `{`, `}` (flow containers), `&`, `*` (anchors/aliases), `!` (tag), `|`, `>` (block scalar headers), `'`, `"`, `%`, `@`, backtick, or `,` (flow separator). Values with leading or trailing whitespace are also quoted so the spaces are preserved.

Embedded double quotes inside a quoted value are escaped with a backslash (`"He said \"hi\""`). Values that look like YAML special tokens - `true`, `false`, `null`, `yes`, `no`, numbers, or ISO dates - are emitted as-is, which means a YAML parser will interpret them as their typed values (boolean, number, date) rather than strings. If you need everything to stay as strings, quote the source or use the JSON tool instead.

How to use convert a list to yaml

  1. 1Paste your list into the input panel, one value per line
  2. 2Output updates live - each non-blank line becomes `- value` in a YAML sequence
  3. 3Values with reserved characters or edge-whitespace are auto-quoted so the result parses cleanly
  4. 4Copy the YAML or download it as a .yaml file from the output panel

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this generator actually does

Fixed behaviors - there are no user-adjustable options on this tool.

Emits a YAML block sequence

Each non-blank input line becomes one `- value` entry in a flat top-level sequence. No mapping, no nesting, no flow syntax. The output is valid YAML 1.1/1.2 that any mainstream parser (PyYAML, js-yaml, yq, Ruby Psych) will read as a list of strings or inferred types.

Automatic quoting for reserved characters

Values containing any of `: # [ ] { } & * ! | > ' " % @ backtick ,` are wrapped in double quotes to prevent the parser from treating them as YAML syntax. Embedded `"` inside a quoted value is escaped with backslash.

Leading and trailing whitespace preserved via quoting

A value with whitespace at the start or end gets auto-quoted too. Without quoting, YAML parsers strip edge whitespace, so the quoting is what makes `" padded "` round-trip exactly as you typed it.

Typed tokens emitted literally

If a value is literally `true`, `false`, `null`, a number, or an ISO date, it is emitted unquoted. A YAML parser will then interpret it as a boolean, number, or date - not a string. Useful when you want types; a footgun when you don't. Prefix with a space or add quotes in your source to force string interpretation.

Blank lines dropped; runs in your browser

Empty and whitespace-only input lines are filtered out before emission. Nothing is sent to our servers - everything runs client-side, which matters when your list contains PII, internal IDs, or anything else you would not paste to a third-party service.

Worked example

Values with `:`, leading `-`, or looking like YAML literals are handled per the rules above.

Input
apple
true
2025-01-01
- bullet already
value with: colon
Output
- apple
- true
- 2025-01-01
- "- bullet already"
- "value with: colon"

Behavior reference

No user options. These are the fixed rules the generator applies.

Rule What it does Example
Sequence wrapping Every non-blank line becomes a `- value` entry in a block sequence `apple` → `- apple`
Reserved-character quoting Values with `: # [ ] { } & * ! | > ' " % @ backtick ,` get wrapped in double quotes `value with: colon` → `"value with: colon"`
Edge-whitespace quoting Values with leading or trailing whitespace get quoted so the spaces survive the round-trip ` padded ` → `" padded "`
Typed tokens stay unquoted `true`, `false`, `null`, numbers, ISO dates are emitted literally - parsers will read them as typed values, not strings `true` → `- true` (parses as boolean)
Embedded quote escaping Double quotes inside a quoted value are escaped with backslash `He said "hi"` → `"He said \"hi\""`
Blank lines (automatic) Empty and whitespace-only input lines are skipped A trailing blank line produces no extra sequence entry

FAQ

When does the tool add quotes around a value?
When the value contains any YAML-reserved character (`: # [ ] { } & * ! | > ' " % @ backtick ,`) or has leading or trailing whitespace. Quoting prevents the parser from treating those characters as syntax. Plain alphanumeric values stay unquoted.
What happens to values like `true`, `null`, or `2025-01-01`?
They are emitted literally without quotes. A YAML parser will then interpret them as a boolean, null, or date - not as strings. If you want them to stay strings, wrap them in quotes in your source input or use the convert-list-to-JSON tool instead, which quotes every value.
Does this tool produce nested YAML or mappings?
No. Output is always a single-level block sequence - one flat list of values. For mappings (`key: value`), nested structures, or anchors/aliases, write the YAML directly; this tool is for the common case where your source is genuinely a list.
What happens to blank lines in my input?
They are skipped. Empty and whitespace-only input lines do not produce empty sequence entries in the output. The output is always a contiguous block of `- value` lines.
Can I parse YAML back into a list?
Yes, use convert-yaml-to-a-list tool - it extracts sequence values (and optionally mapping keys) into one item per line.