Tech News, Tech & Coding · Free Online Tools

IT Question Answer
Tools
Developer & Text ToolsFree100% Client-Side

YAML Validator & Formatter

Validate YAML with line and column errors, reformat it, sort keys and convert between YAML and JSON.

100% privateRuns instantly in-browserUpdated regularly

Advertisement

Runs in your browser

Your input is processed on your device and is not uploaded to our servers.

Fast

No queues and no upload wait, so results appear as soon as you act.

Clean and simple

Dark mode, no popups, and no signup.

What you get

  • Syntax errors with line and column
  • Reformat with 2 or 4 space indent
  • YAML to JSON and JSON to YAML
  • Optional alphabetical key sort
  • 100% client-side

What the YAML tool does

YAML is the format behind Kubernetes manifests, Docker Compose, GitHub Actions and many other config files. It is easy to read but easy to break: one wrong indent changes the meaning, and a tab can stop the file from loading. This tool checks your YAML, points to the line and column of a syntax error, reformats it with a clean indent, and converts to and from JSON.

How to use it

  • Validate and format: paste YAML. If it is valid it is rewritten with consistent indentation. If not, the error shows the line and column.
  • YAML to JSON: paste YAML and copy the JSON.
  • JSON to YAML: paste JSON and copy the YAML.
  • Choose a 2 or 4 space indent and, if you like, sort the keys alphabetically.

Common YAML errors

  • Tabs used for indentation. YAML allows spaces only.
  • Inconsistent indentation, so a key lands under the wrong parent.
  • A missing space after a colon: key:value is not a mapping, key: value is.
  • Unquoted special values: yes, no, on, off and null can be read as booleans or null in some parsers. Quote text that must stay a string.
  • A colon or a hash inside a value that is not quoted.

Good to know

The tool reads your YAML as data and writes it back, so comments are not kept after formatting or conversion. Keep your original if the comments matter. Different tools follow slightly different YAML versions, so also test the file in the system that will use it.

Related tools

Advertisement

Frequently asked questions

Yes. A YAML syntax error is reported with its line and column.

No. Comments are not kept because the file is parsed into data and written back.

Yes, and JSON to YAML as well.

Yes. Turn on the sort keys option to order them alphabetically.

No. Everything runs in your browser.