Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

YAML validator & converter

Check YAML (.yml) files for errors with the exact line, spot values other tools read differently, tidy the YAML, and convert YAML to JSON and back.

How to use

  1. Paste your YAML (a config file, a Docker Compose or GitHub Actions file, a Kubernetes manifest, front matter) into the box.
  2. The result appears as you type: Valid YAML, or the line number and what is wrong there. Go to the line selects that line in the box.
  3. Read the Worth a look notes: they point at values that other YAML tools may read differently, such as yes, no, on or numbers with a leading zero.
  4. Choose tidy to get clean, evenly indented YAML, or switch to JSON to YAML to go the other way.

Keyboard and touch

TabMove to the next control (the boxes do not take tab characters: YAML does not allow tabs for indenting)
TypingThe check runs a moment after you stop typing

Tips

  • Indent with spaces only, and keep children of one key at exactly the same indent.
  • Put a space after every colon in key: value. Without it, YAML reads key:value as one piece of text.
  • Quote values that look like something else: "yes", "off", "1.10", "0755", phone numbers and postcodes.
  • A value that contains : or starts with *, &, !, [, { or @ needs quotes.
  • Use | to keep line breaks in a long text, > to fold them into spaces.

About this validator

The checker is our own reader for YAML 1.2 written for this page: block mappings and lists, flow [ ] and { }, plain, single- and double-quoted text with escapes, literal and folded blocks with + and - chomping, comments, several documents separated by ---, anchors, aliases and << merge keys, and the standard types (null, true and false, whole numbers including 0x and 0o, decimals, .inf and .nan).

It stops at the first error and names the line. Complex keys written with ? are not supported, and custom tags are ignored. JSON output keeps the order of keys and very large whole numbers exactly. Tidied YAML loses comments and writes anchors out in full.

Nothing is stored or sent: everything runs on your device.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product