Ffile2fix
Sign in Get started

What is a .yaml file?

A .yaml or .yml file is a human-readable configuration file that uses indentation to express structure. It powers Docker Compose, Kubernetes manifests, GitHub Actions workflows, Ansible playbooks and many app settings files.

Key facts

  • Structure is defined by indentation with spaces; tab characters are not allowed for indentation.
  • MIME type is application/yaml (registered in RFC 9512, 2024); .yaml and .yml are interchangeable extensions.
  • Supports comments with #, multi-line strings with | and >, anchors (&) and aliases (*), and multiple documents separated by ---.
  • YAML 1.2 is a superset of JSON, but many parsers still follow YAML 1.1, where unquoted yes, no, on and off become booleans.
  • Usually hand-written by developers and DevOps engineers, or generated by tools like Helm and Kustomize.

How to open a .yaml file

Windows

Open it in VS Code (with the Red Hat YAML extension for validation) or Notepad++. Avoid Notepad's default settings if it inserts tabs.

macOS

Open it in VS Code or any code editor; install yamllint with Homebrew (brew install yamllint) to check it in Terminal.

Linux

Edit it in any text editor and run yamllint file.yaml to validate, or python3 -c 'import sys,yaml; yaml.safe_load(open(sys.argv[1]))' file.yaml if PyYAML is installed.

Common problems and fixes

"found character '\t' that cannot start any token"
A tab was used for indentation. Replace tabs with spaces and set your editor to insert spaces in YAML files.
"mapping values are not allowed here"
Usually a missing space after a colon, a colon inside an unquoted value, or wrong indentation on the line above. Add the space after key: or quote values that contain colons.
"did not find expected key" or "bad indentation of a mapping entry"
One line is indented by a different number of spaces than its siblings. Align items at the same level and check list dashes line up.
Values like NO, yes, 012 or 1.10 come out wrong
YAML 1.1 parsers turn NO into false, 012 into an octal number and 1.10 into 1.1. Quote values that must stay strings, for example country: "NO" or version: "1.10".

Often converted to or from: JSON, TOML, INI, .env, XML

Frequently asked questions

What is the difference between .yaml and .yml?

None; both extensions describe the same format. The official recommendation is .yaml, but many tools such as Docker Compose and GitHub Actions accept either.

Can I use tabs in YAML?

Not for indentation; the YAML specification forbids it. Tabs inside quoted strings are fine.

Is valid YAML always valid for Docker or Kubernetes?

No. Correct YAML syntax only means the file parses; each tool also has its own schema of allowed keys. Use docker compose config or kubectl apply --dry-run=client to check those.

See all file types β†’ Β· Browse error fixes β†’