Free YAML sample files

Human-friendly data serialisation that relies on indentation. The format of most infrastructure configuration. Download valid YAML test files in 4 exact sizes, from 1 KB to 1 MB, each with a checksum.

Extension
.yaml
MIME type
application/yaml
Kind
Text
Category
Configuration

YAML files by size

Every file below is a valid YAML Ain't Markup Language file of exactly the stated size. Open a file's page for its checksum and contents, and to preview it in your browser before downloading.

YAML sample files by size
FileSizeContentsDownload
1 KB YAML samplesample-yaml-1kb.yaml 1 KB1,024 bytes Records: 3 Download YAML
10 KB YAML samplesample-yaml-10kb.yaml 10 KB10,240 bytes Records: 42 Download YAML
100 KB YAML samplesample-yaml-100kb.yaml 100 KB102,400 bytes Records: 426 Download YAML
1 MB YAML samplesample-yaml-1mb.yaml 1 MB1,048,576 bytes Records: 4,336 Download YAML

More YAML samples

Hand-designed files with realistic content or a specific edge case.

Curated YAML sample files
FileSizeContentsDownload
Sample Docker Compose YAMLsample-docker-compose.yaml 744 B744 bytes Features: Anchors and aliases, sequences, nested mappings, quoted strings, comments Download YAML

What is a YAML file?

YAML expresses mappings, sequences and scalar values using indentation rather than brackets, which makes it pleasant to write by hand. Kubernetes, Docker Compose, GitHub Actions and Ansible are all configured with it.

YAML is a superset of JSON and has a great deal of syntax, including anchors for reusing values and several ways of writing multi-line strings.

How to recognise a YAML file

No signature bytes. YAML files are identified by parsing their content.

Extension.yaml
MIME typeapplication/yaml
SpecificationYAML 1.2.2
Extensions.yaml and .yml
IndentationSpaces only; tabs are not allowed
FeaturesAnchors, aliases, tags, multiple documents per file

What to test for

These are the behaviours that most often go wrong when software handles YAML files.

Strengths of YAML

  • Easy for people to read and write, with support for comments.
  • Anchors and aliases avoid repeating shared configuration.

Limitations of YAML

  • Significant indentation makes small mistakes change the meaning silently.
  • Implicit typing turns some plain values into booleans or numbers unexpectedly.

Typical uses of YAML test files

  • Testing configuration loaders and linters
  • Checking CI pipeline tooling
  • Testing converters between YAML and JSON

Software that opens YAML

  • Kubernetes, Docker Compose, Ansible, GitHub Actions
  • PyYAML, js-yaml, SnakeYAML and yq

Specifications

Related

YAML sample files: questions

Are the samples a single YAML document?
Yes. Each file is one document with a top-level mapping and a sequence of records.
What is the MIME type of a YAML file?
The MIME type is application/yaml. The file extension is .yaml.
Is a sample YAML file the same as a dummy or example YAML file?
Yes. Sample, test, dummy and example YAML files are different names for the same thing: a YAML file with known contents that stands in for a real one. Any file on this page will do wherever a tutorial or a test plan asks for a dummy YAML file.