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.
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
# 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
JSON
JSON is a lightweight text-based data format commonly used to exchange structured data between applications and APIs.
XML
XML (Extensible Markup Language) is a text format that describes data using nested, self-labelled tags, designed for documents and long-lived system-to-system messaging.
CSV
CSV (Comma-Separated Values) is a plain-text table format where each line is a row and each field is separated by a delimiter, usually a comma.
JSON Schema
JSON Schema is a declarative vocabulary, itself written in JSON, that describes the expected structure, types and constraints of a JSON document so it can be validated automatically.
API
An API (Application Programming Interface) is a defined contract that lets one piece of software request data or actions from another without knowing how it works internally.
Base64
Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters so it can travel safely through text-only channels.
Related tools
Related guides
JSON vs XML: Which Format Should You Use?
A practical JSON vs XML comparison: syntax, size, parsing speed, schemas, comments, attributes and metadata — plus clear guidance on which format fits which job.
What Is JSON? A Plain-English Guide
JSON explained without jargon: what it is, how the syntax works, which data types it supports, where it is used and how it differs from JavaScript objects.
CSV vs JSON: Choosing the Right Data Format
Compare CSV and JSON on structure, nesting, file size, streaming, typing and tooling, with clear guidance on which to use for exports, APIs and analytics pipelines.
How to Format JSON (Beautify, Indent and Minify)
Learn how JSON formatting works, see a before-and-after example, fix the errors that block beautifying, and format JSON online in your browser without uploading a file.