⌘K

Data Formats

YAML

YAML is a whitespace-indented data format designed to be written and read by people, most often used for configuration files such as CI pipelines and Kubernetes manifests.

Updated 12 Aug 2026

A human-first data format

YAML expresses the same data model as JSON — mappings, sequences and scalars — but replaces braces and brackets with indentation. Every valid JSON document is also valid YAML, which is why most YAML parsers can read JSON unchanged.

The trade-off is deliberate: YAML is optimised for humans typing configuration by hand, not for machines exchanging millions of messages. It supports comments, multi-line strings, anchors that let you reuse a block, and multiple documents in one file separated by three dashes.

Where you will meet it

  • GitHub Actions, GitLab CI and CircleCI pipeline definitions
  • Kubernetes manifests and Helm charts
  • Docker Compose files
  • Static site and linter configuration such as .eslintrc.yaml

Gotchas worth knowing

Tabs

YAML forbids tab characters for indentation. Configure your editor to insert spaces.

Accidental booleans

In older YAML versions, unquoted yes, no, on and off parse as booleans. Quote them when you mean the word.

Leading zeros

A value like 0755 may be read as an octal number. Quote version numbers and identifiers.

Silent indentation errors

A one-space mistake can move a key into the wrong parent while still parsing successfully.

JSON Formatter

Paste JSON and export YAML, XML or CSV without leaving your browser.

Try JSON Formatter

Characteristics

  • Indentation defines structure — no braces or brackets
  • Superset of JSON, so JSON parses as valid YAML
  • Supports comments, anchors, aliases and multi-line strings
  • Multiple documents can live in a single file

Common uses

  • CI/CD pipeline definitions
  • Container orchestration manifests
  • Application and tooling configuration
  • Data fixtures and seed files

Advantages

  • Far less punctuation noise than JSON or XML
  • Comments make configuration self-documenting
  • Anchors remove duplication in large manifests
  • Diffs stay readable because each value sits on its own line

Limitations

  • Indentation errors are easy to make and hard to spot
  • Implicit type conversion produces surprising values
  • Specification is large, so parsers differ in edge cases
  • Poor fit for high-volume machine-to-machine messaging

Examples

The same user record in YAML, with a comment
# Primary account owner
id: 4821
name: Ada Lovelace
active: true
roles:
  - admin
  - editor
address:
  city: London
  postcode: "NW1 6XE"

Frequently asked questions

What is YAML used for?

Configuration that people edit by hand — CI pipelines, Kubernetes manifests, Docker Compose files and tool settings.

Is YAML better than JSON?

For hand-written configuration, usually yes. For API payloads, JSON is faster, stricter and better supported.

Can YAML read JSON files?

Yes. YAML is a superset of JSON, so a valid JSON document parses as YAML.

Why does YAML break with tabs?

The specification only allows spaces for indentation, so a tab is a hard parse error.

What does the --- line mean?

It separates documents, allowing several independent configurations in one file.

Related terms

All terms

Related tools

Related guides

All guides