What is YAML? A Beginner-Friendly Guide with Examples
By ZonoTools8 min read

What is YAML?
YAML is a way to write structured data that humans can read easily—think settings, checklists, and nested information without a sea of curly braces. The name officially means YAML Ain’t Markup Language: it is not HTML-style markup for documents; it is a data format, like JSON, but tuned for readability.
When someone asks what is YAML, the short answer is: a text format for describing lists and maps using indentation and simple punctuation. Programs parse YAML into the same kinds of objects JSON gives you (objects, arrays, strings, numbers, true/false, null).
Basic syntax
YAML builds on three ideas: key-value pairs, lists, and indentation.
- Key-value: write
key:then the value on the same line or indented below. - Lists: start each item with a
-dash. - Indentation: nesting uses spaces (usually two per level). YAML cares about alignment—if two lines line up wrong, they might attach to different parents.
Here is a single small file that shows all three:
app is a map with name and port. tags is a list of two strings. Everything under app: is indented one step so it belongs to app.
app:
name: demo
port: 3000
tags:
- web
- apiYAML vs JSON
Both YAML and JSON describe the same kind of data (objects and arrays). JSON uses {, }, commas, and quoted strings; YAML relies more on layout and often skips quotes for simple text.
JSON is everywhere in APIs and browsers. YAML shows up where people edit files by hand—configs, pipelines, and infrastructure snippets. For a deeper comparison and when to pick each format, read JSON vs YAML: differences and use cases.
Neither format is “better” universally; teams pick YAML when readability and diffs matter, and JSON when machines exchange data over HTTP.
Real-world use cases
Kubernetes and many cloud tools expect YAML manifests: what should run, how many copies, which ports open. Operators skim these files in Git before anything reaches a cluster.
CI/CD systems (GitHub Actions, GitLab CI, and similar) often describe pipelines in YAML—steps, triggers, and environments—so changes are reviewable like code.
Application config files frequently use YAML or YAML-like styles so non-developers can tweak feature flags or URLs without touching source code.
When you outgrow hand-writing YAML from scratch, it helps to start from JSON you already trust and convert once—see how to convert JSON to YAML step-by-step.
Convert JSON to YAML
If you have JSON from an API, a tutorial, or a generator and want the friendlier YAML layout, use JSON to YAML in your browser: paste JSON, copy YAML, then tune indentation or quotes if your tool expects them. To double-check syntax afterward, run your file through YAML Validator before you commit.
Learning what is YAML is mostly practice: read small samples, respect indentation, and treat quotes as your safety net when values look like dates, booleans, or sentences with colons.