DO IT EASY APP
English

YAML formatter and validator

Validate YAML, fix indentation and see errors by line; convert YAML ↔ JSON. Comments are kept.

  • No sign-up, no fees.
  • Validate YAML and fix its indentation, with errors shown by line and column.
  • Convert YAML to JSON and JSON to YAML.
  • Comments are kept and multi-document (---) files are supported.
  • 2 or 4 space indentation.
  • What you type is processed, but never shared with anyone.

YAML formatter and validator: how to use it

  1. With Format and validate selected, paste your YAML.
  2. If it's valid, the tidied version appears below; if not, you see the line and column of the error.
  3. Choose 2 or 4 spaces of indentation.
  4. Copy or Download the result.

Choose YAML → JSON to convert to JSON, or JSON → YAML for the reverse.

What is YAML?

YAML is a human-friendly data format written with indentation. Docker Compose, Kubernetes, GitHub Actions, Ansible and many apps use YAML for configuration. It's easy to read but very sensitive to indentation: a single space can change the meaning or break the file.

Common YAML mistakes

  • Using tabs: YAML indentation must use spaces; tabs cause errors.
  • Inconsistent indentation: Items at the same level must start with the same number of spaces.
  • No space after the colon: Write name: Ada, not name:Ada.
  • Duplicate keys: The same key can't appear twice at one level; the tool catches this.
  • Special characters: Quote values that contain : or #.

YAML vs JSON

JSON uses braces and quotes and is strict and precise for machines; YAML uses indentation and allows comments. Every JSON document is also valid YAML. The tool follows YAML 1.2: values like no, on and yes stay as text, so the country code "NO" doesn't turn into false.

To format JSON use the JSON formatter; for XML, XML validator and formatter; to compare two JSON files, JSON diff.

Frequently asked questions

Where is the error in my YAML?

The tool shows the line and column; often the real problem is the indentation on the line above.

Are my comments removed?

No, formatting keeps comments. Converting to JSON drops them, since JSON has no comments.

Are multi-document YAML files supported?

Yes. Documents separated by --- are formatted separately and become an array in JSON.

Does it work for Kubernetes and Docker Compose files?

Yes, they're standard YAML. The tool checks syntax only, not whether the field names are right.

Is my data sent anywhere?

It's processed in your browser. What you type is processed, but never shared with anyone.

Related tools