Rates TodayNIFTY25,819.3+2.34%SENSEX83,938.3+2.32%Gold 24K ₹11,235.62/g down271.8Silver ₹128.69/g down5.77
InsightforGeeks

YAML Formatter & Validator

Paste YAML to check that it is valid and to re-indent it neatly with 2 or 4 spaces. Comments are kept, you can sort the keys, and files with several documents separated by --- are supported. Errors come with the line and column, and duplicate keys are caught. Useful for Docker Compose, Kubernetes, GitHub Actions and other configuration files. It runs in your browser, so nothing is uploaded.

How to use it

  1. Paste your YAML, or press Sample.
  2. Choose the indent, and whether to sort the keys.
  3. Press Format, or Check only to validate without changing anything.
  4. Copy the result or download it as a .yaml file.

Frequently asked questions

Is what I paste uploaded anywhere?

No. This tool runs in your browser, on your own device, and what you paste is never sent to our server.

Does it keep my comments?

Yes. Comments stay with the lines they belong to. Spacing is normalised, so a comment after a value may move to sit one space after it.

Why is my YAML invalid?

Common causes are tabs used for indentation (YAML allows only spaces), a list item or key at the wrong indentation, a missing space after a colon or dash, or an unclosed bracket or quote. The message shows the line and column.

What happens with duplicate keys?

They are reported as an error. Many tools silently keep the last value, which hides mistakes.

Can I convert YAML to JSON?

Yes, with the JSON, YAML and CSV converter. This tool only formats and checks YAML.

Related tools

These tools run entirely in your browser and are provided free, without warranty. Check important results before using them in production.