What is a YAML file?

YAML is a plain text format for settings and structured data. It uses line breaks and indentation instead of brackets, so it is easy to read. Docker Compose, GitHub Actions, Kubernetes and many apps use it. It is strict about spaces: a tab or a wrong indent breaks it.

Drop your file here

or select file

Images, video, audio, documents, data, archives, fonts and more.

About YAML file:

01YAML at a glance

Full name
YAML Ain't Markup Language
Type
Plain text for settings and structured data
Extension
.yaml (also .yml)
Current spec
YAML 1.2.2
Structure
Indentation and line breaks, no brackets needed
Rule
Spaces only for indentation

02What is a YAML file

YAML is a plain text format for settings and structured data. Instead of brackets and quotes it uses line breaks and indentation, so it reads almost like an outline. Docker Compose, GitHub Actions, Kubernetes and many apps use it for their settings.

Indentation is the syntax, so it is strict. The YAML specification says tab characters must not be used in indentation, because systems treat tabs differently. A key must not appear twice on the same level, and a plain value that contains a colon followed by a space is read as another key, so such a value needs quotes.

YAML 1.2 was made so that JSON files are valid YAML, and it adds comments, several documents in one file, anchors and aliases to reuse a block, and tags for types. Those features are why a full YAML parser is large and why different programs differ in details.

This tool does a basic check of the mistakes people make most often: tabs for indentation, a second colon in a value, repeated keys, bad dedents and quotes or brackets that never close. It is not a full YAML parser, so a file can pass this check and still be rejected by a program that is stricter.

03Good and bad sides

Good

  • Easy for people to read and write
  • Comments are allowed, unlike JSON
  • Handles nested lists and objects
  • The standard for many tools' settings files

Bad

  • A wrong indent changes the meaning or breaks the file, and the mistake is hard to see
  • Tabs are not allowed for indentation
  • Some values are read as a different type than you meant (for example, a bare yes or a version like 1.10)
  • Parsers differ in details, so the same file can behave differently

04Best for

  • Settings that people edit

    Readable, with comments. Use spaces only and quote any value that has a colon in it.

  • Data where exact types matter

    A bare yes or a version like 1.10 can be read as a different type. Quote such values.

  • Moving data between systems

    JSON is stricter and more widely supported for data exchange.

05How to open it

Any system
A text editor, with VS Code and similar editors showing YAML errors as you type
Programming
Libraries exist for every language (PyYAML, js-yaml, SnakeYAML)
Spreadsheets
Not a table format: convert to CSV or JSON first

06Convert and compare

Related formats: JSON, XML, CSV

Sources