Overview
Introduction
NestedText's minimal, everything-is-a-string format is easy to hand-edit but not every tool speaks it natively, most orchestration and CI systems expect YAML. This tool parses NestedText's core syntax and rebuilds it as nested YAML.
Because NestedText carries no type information, the resulting YAML deliberately keeps every value as a string rather than guessing that `3` should become a number or `true` should become a boolean, that guess would be a real information loss, not a convenience.
What Is NestedText to YAML Converter?
A NestedText-to-YAML converter reads NestedText line by line, using each line's indentation and leading marker (`key:`, `- `, or `> `) to determine whether it's a mapping entry, a list item, or a line of multiline text, and builds up the corresponding nested value.
That value, where every leaf is a string, is then serialized as YAML using the same stringifier every other tool in this category uses, quoting any value whose plain form would be misread as a different type when parsed again.
How NestedText to YAML Converter Works
The input is scanned into a flat list of line descriptors (indentation, type, and content), skipping blank lines and full-line comments. A recursive block parser then groups consecutive descriptors that share the same indentation and type into a single mapping, list, or multiline string, descending into deeper indentation wherever a `key:` or `-` line has no inline value.
Because siblings in a well-formed NestedText document must be homogeneous (all mapping entries, all list items, or all text lines), a change in type at the same indentation level is reported as a parse error rather than silently misinterpreted.
When To Use NestedText to YAML Converter
Use it when a NestedText-based config needs to feed into a YAML-only pipeline, CI system, or deployment tool.
It's also useful for double-checking how a NestedText document's structure is actually being interpreted, seeing it as YAML makes the nesting more visually explicit.
Often used alongside YAML to NestedText Converter, YAML to JSON Converter and YAML Formatter & Prettifier.
Features
Advantages
- Correctly reconstructs arbitrarily nested mappings, lists, and multiline strings from NestedText's indentation-based syntax.
- Never silently reinterprets a string as a number or boolean, preserving exactly what the source NestedText meant.
- Reports clear, line-numbered errors for syntax outside the supported subset instead of guessing.
- Runs entirely client-side with no added dependency, so configuration data never leaves your browser.
Limitations
- Every converted value is a YAML string; if you need actual numbers or booleans, you'll need to adjust the YAML by hand afterward.
- Inline compact dictionary/list syntax (where some NestedText tooling allows `{a: 1}` or `[1, 2]` on one line) is not supported by this parser.
- Blank lines inside a multiline `> ` text block are not specially preserved as empty content lines; only lines with the `> ` marker are treated as part of the string.
Examples
Best Practices & Notes
Best Practices
- After converting, manually adjust any values that should be YAML numbers or booleans if your downstream tooling expects native types.
- Keep source NestedText files free of inline compact syntax if you plan to convert them with this tool.
- Use the reported line numbers to fix syntax errors directly in the original NestedText file, not just the converted output.
Developer Notes
The parser is hand-written and line-oriented (no NestedText library dependency), first tokenizing every line into a flat descriptor (indent, type, content) and then recursively grouping consecutive same-indent, same-type descriptors into mappings, lists, or joined multiline strings. This two-pass structure keeps the indentation logic isolated from the value-building logic, making it easier to report precise line numbers on error.
NestedText to YAML Converter Use Cases
- Feeding a NestedText-based config into a YAML-only CI or deployment pipeline
- Visualizing a NestedText document's nested structure as YAML for easier review
- Migrating a project's configuration format from NestedText to YAML
- Generating YAML fixtures for tests from an existing NestedText source
Common Mistakes
- Expecting numeric or boolean-looking values to convert to native YAML types, they stay strings, matching what NestedText actually stored.
- Mixing list items and mapping entries at the same indentation level, NestedText (and this parser) requires siblings to be consistent.
- Using tabs for indentation, NestedText requires spaces, and this parser reports tab indentation as an explicit error rather than guessing at the intended depth.
Tips
- If a document fails to parse, check the reported line for mixed sibling types first, it's the most common structural issue.
- Use YAML to NestedText afterward to confirm a specific document round-trips the way you expect.
- Run the result through the YAML Formatter if you want consistent indentation after conversion.