YAML File Format (.yaml)
A YAML file holds structured data written with indentation instead of brackets, extending JSON's data model with comments, references and multi-line strings meant to be edited by a person.
YAML at a glance#
| Full name | YAML Ain't Markup Language |
|---|---|
| File extension | .yaml |
| Category | Data Files |
| Developer | Clark Evans, Ingy döt Net, and Oren Ben-Kiki |
| First released | 2001 |
| MIME types | application/yamltext/yaml |
| Other extensions | .yml |
| Compression | Uncompressed |
| Specification | YAML 1.2.2 Specification |
| FileFlip support | FileFlip reads and writes this format |
What a .yaml file can hold#
These are the things a YAML file either supports or does not, and they are what decides whether a conversion keeps everything or quietly drops something.
| Human readable | Yes |
|---|---|
| Comments | Yes |
| Schema or validation | Yes |
Strengths and limitations of YAML#
What YAML does well
- Comments and blank lines survive editing, which JSON's grammar doesn't allow at all
- Anchors and aliases let one block of the file reference another instead of repeating it
- Block syntax for multi-line strings means embedding a paragraph or a script doesn't need escaped newlines
Where YAML falls short
- Indentation is significant, so a file edited with mixed tabs and spaces fails to parse
- Unquoted values are type-inferred, so a country code like NO for Norway can silently become the boolean false
- Anchors and aliases don't survive a round trip through JSON, which has no way to express a reference
- Nesting depth is harder to see at a glance than in a format with explicit brackets
Choose YAML for configuration a person edits by hand and wants to comment, like CI pipelines or Kubernetes manifests.
Convert YAML to JSON when a program needs to consume the file and comments and anchors aren't needed, since most JSON libraries won't read YAML directly.
How to open a .yaml file#
A .yaml file opens in the programs below, grouped by the platform you are on. If you would rather not install anything, FileFlip converts YAML into a format your machine already opens, and it does it in the browser tab rather than on a server.
| Platform | Programs that open it |
|---|---|
| Windows | VS Code, Notepad++, Sublime Text |
| macOS | VS Code, Sublime Text, TextEdit |
| Linux | VS Code, vim, gedit |
| Web | FileFlip |
YAML questions people ask#
Why does YAML turn NO into false?
YAML's core schema treats a set of unquoted words, including no, off and n, as boolean false, and yes, on and y as true. This is called the Norway problem because a two-letter country code or an abbreviation typed without quotes gets silently converted to a boolean. Wrapping the value in quotes, so it reads as the string NO rather than the word no, avoids it.
Do YAML comments survive converting to JSON?
No. Converting a YAML file to JSON drops every comment, because JSON's grammar has no comment syntax to hold them. The same is true of blank lines used for visual grouping; only the actual data survives the conversion.
Why does my YAML file fail to parse after I edited it?
YAML uses indentation to show nesting, and mixing tabs and spaces, or indenting a line by the wrong number of columns, breaks the structure the parser is reading. Unlike JSON's braces, there's no closing character to catch the mistake, so the reported error often points several lines below where the actual problem is.
What happens to YAML anchors and aliases when converting to JSON?
YAML anchors and aliases let one part of a file reuse a block defined elsewhere, and converting to JSON resolves every alias into a full copy of the data it pointed to, since JSON has no mechanism for internal references. The result is valid but larger, and editing one copy in the JSON no longer updates the others.
Converting YAML files#
Convert YAML to another format
Convert another format to YAML
Every conversion runs inside your browser. The file is read from your disk, the work happens on your own machine, and nothing is uploaded. How FileFlip works names the engine behind each family and how to verify that for yourself.