YAML Parser & Viewer

Paste YAML and explore the parsed result as a collapsible tree. Every value is labeled with the type the parser assigned to it, which makes it easy to spot strings that silently became numbers, booleans, or timestamps.

YAML
Parsed structure

Parsed structure will appear here.

Related tools

What a YAML parser does

A parser turns the text of a YAML file into data your program can use: mappings become objects or dictionaries, sequences become arrays or lists, and scalars become strings, numbers, booleans, nulls, or timestamps. The tricky part is that YAML decides the scalar type by looking at the text, so the same characters can mean different things depending on quoting.

Type inference cheat sheet

YAML textParsed typeNotes
hellostringPlain scalar
"123"stringQuotes force a string
123int
1.5, 1e3float1e3 is 1000
0x1F, 0o17intHex 31, octal 15
true, falsebooleanCase-insensitive in most parsers
yes, no, on, offstring (YAML 1.2) or boolean (YAML 1.1)Quote to be safe
null, ~, emptynull
2024-01-15timestampQuote to keep as string
- aarraySee YAML arrays
k: vobjectSee YAML dictionaries

Using the parser to debug config

The most common YAML bugs are not syntax errors at all; the file parses fine but a value has the wrong type. A version number like 1.10 becomes the float 1.1, a postal code like 0123 loses its leading zero, and a country code like NO becomes false in older parsers. Load your file here, expand the tree, and check the type badges next to any value that matters. When you find a problem, quote the value and re-check with the YAML validator.

Frequently asked questions

Why is my value shown as a number when I meant a string?

YAML infers types from the text. Anything that looks like a number (123, 1.5, 1e3, 0x1F, 0o17) becomes a number. Wrap the value in quotes to keep it as a string.

Why did 2024-01-15 become a timestamp?

Unquoted dates in ISO format are parsed as timestamps by YAML 1.1 and by js-yaml's default schema. Quote the value if your application expects a plain string.

Is yes parsed as true?

Not here. This parser follows YAML 1.2, where only true and false are booleans. YAML 1.1 parsers such as PyYAML treat yes, no, on, and off as booleans, which is the source of the famous Norway problem (NO becoming false). Quote these words to be safe in every parser.

What does the parser do with anchors and aliases?

Aliases are resolved, so the tree shows the referenced data in place. Merge keys (<<) are also applied.