Toolbox

YAML Parser

YAML ("YAML Ain't Markup Language") is a human-friendly format for structured data. Paste or type YAML to parse it, see the data it represents, and learn how YAML is put together — in friendly and technical terms.

How YAML is structured

Friendly view

Think of YAML as a neat outline. You give things names (keys), assign them values, make lists of items, and show what belongs inside what by indenting with spaces.

Technical view

A YAML document is built from nodes: scalars (single values), mappings (key/value pairs), and sequences (ordered lists). Structure is expressed through indentation (block style) or brackets/braces (flow style).

At a glance

  • key: value — a mapping entry
  • - item — a sequence item
  • indented — nested under a parent
  • # text — a comment (ignored)

Parsing runs as you type. Input stays in your browser.

Parsed result

Parsed successfully — top level is a mapping (object). Below is the data as JSON plus a structural breakdown.

Data (as JSON)

{
  "app": "toolbox",
  "version": 1,
  "features": [
    "friendly parser",
    "learn by example"
  ],
  "settings": {
    "teaching_mode": true,
    "theme": "auto"
  }
}

Structure breakdown

- document: mapping (object) with 4 keys
  - app: string: "toolbox"
  - version: number: 1
  - features: sequence (list) with 2 items
    - [0]: string: "friendly parser"
    - [1]: string: "learn by example"
  - settings: mapping (object) with 2 keys
    - teaching_mode: boolean: true
    - theme: string: "auto"

Core concepts (friendly + technical)

Click Try it to load an example into the editor and see how it parses.

Mappings (key: value)

Friendly: Like a labeled form or dictionary: each name points to a value.

Technical: A mapping is an unordered collection of key/value pairs. In block style, each pair is written as `key: value`.

name: Ada
role: Engineer
active: true

Tip: Always put a space after the colon: `key: value`, not `key:value`.

Sequences (lists)

Friendly: A shopping list: items in order, one after another.

Technical: A sequence is an ordered collection. In block style, each item starts with `-` (dash + space).

tools:
  - hammer
  - wrench
  - saw

Tip: Items in a sequence keep their order, which often matters for programs.

Nesting & indentation

Friendly: Indentation is how YAML shows “inside of” — like folders inside folders.

Technical: Whitespace (spaces) defines structure and hierarchy. Child nodes are indented under their parent key or list item.

person:
  name: Ada
  address:
    city: London
    country: UK
  hobbies:
    - math
    - writing

Tip: Use spaces, never tabs. Pick a consistent indent width (2 spaces is common).

Scalars & types

Friendly: A single, simple value — a word, number, true/false, or nothing.

Technical: Scalars are leaf values (not collections). YAML recognizes types like strings, integers, floats, booleans, and null.

title: "YAML Basics"
count: 3
price: 9.99
published: false
nothing: null
also_nothing: ~

Tip: Quotes are optional for simple strings, but useful when text has special characters like `:` or `#`.

Comments

Friendly: Notes to humans that the computer skips over.

Technical: A comment starts with `#` and runs to the end of the line. Comments are not part of the parsed data.

# Service configuration
port: 8080 # default web port
debug: true

Tip: Use comments to explain why, not to restate the obvious.

Multiline strings

Friendly: A way to write paragraphs or blocks of text without cramming them onto one line.

Technical: `|` (literal) preserves line breaks. `>` (folded) folds newlines into spaces, treating text like a wrapped paragraph.

literal: |
  Line one
  Line two
folded: >
  This will become
  a single wrapped
  line.

Tip: These block scalars are great for descriptions, scripts, or messages.

Flow style (inline)

Friendly: A compact, one-line way to write lists and objects, similar to JSON.

Technical: Flow collections use brackets: sequences `[a, b]` and mappings `{key: value}`. They can be mixed with block style.

tags: [yaml, tutorial, beginner]
point: {x: 10, y: 20}

Tip: Flow style is handy for short collections; block style is usually easier to read.

Common mistakes & quick tips

  • Spaces, not tabs: indentation must use spaces, and siblings must align.
  • Space after colon: write key: value (the space matters in mappings).
  • Quote tricky strings: quote values containing :, #, leading zeros, or true/false when you mean text.
  • Consistent nesting: children are indented further than their parent; same-level items share the same indent.
  • Start simple: master mappings, sequences, and scalars before advanced features like anchors (&/*) or multi-document files (---).

BUILT WITH ♥ AND 8 BITS ON SVELTEKIT