YAML ("YAML Ain't Markup Language") is a human-readable data format used for configuration files. It uses indentation (spaces, never tabs) to define structure.
name: HackYourFuture
version: 2.1
active: true
count: 42
# This is a comment
name: app # Inline comment
unquoted: hello world
single: 'contains "double" quotes'
double: "contains 'single' quotes and \\n newlines"
# Literal block (|) — preserves newlines exactly
script: |
echo "line 1"
echo "line 2"
# Folded block (>) — joins lines into one
description: >
This will become
a single long line
of text.
fruits:
- apple
- banana
- cherry
Inline style (JSON-compatible):
fruits: [apple, banana, cherry]
database:
host: localhost
port: 5432
credentials:
user: admin
password: secret
services:
- name: web
port: 3000
- name: api
port: 8080
enabled: true
debug: false
value: null # or ~
| Mistake | Wrong | Correct |
|---|---|---|
| Using tabs | ⇥key: value |
key: value (spaces) |
Missing space after : |
name:value |
name: value |
| Inconsistent indentation | Mix of 2 and 4 spaces | Pick one, stick to it |
| Unquoted special chars | message: yes (parsed as true) |
message: "yes" |
key: value, not key:valueitem, not itemyes, no, on, off (YAML treats these as booleans)The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.