Skip to content

YAML Validator & Formatter

Checks YAML for errors with the exact line and a plain-language fix, and re-indents it without losing your comments.

Your YAML stays on this device

This tool runs entirely inside your web browser. Your YAML is processed on your own device and is never sent to our servers. How this works

Comments and the order of list items are always kept.

Tidied YAML

YAML Validator & Formatter checks a YAML file as you type, points at the exact line of any problem and explains it in plain language, then re-indents the file consistently. Your comments and the order of your list items are kept, so it is safe to run on Kubernetes manifests, CI workflows and docker-compose files. Everything happens in your browser.

How to check and tidy YAML

  1. Paste your YAML into the left box, or open a .yaml or .yml file.
  2. Problems appear straight away with their line number. Click Show to jump to one.
  3. Once it is valid, the tidied version appears on the right. Choose 2 or 4 spaces, and optionally sort keys.
  4. Click Copy or Download.

The errors this catches

Values that are not what they look like

YAML converts some bare words automatically, which causes real bugs. In older YAML 1.1 tools, no,off and n become false, and yes and on becometrue, so a country code like NO turns into a boolean. Version numbers such as1.10 can lose their trailing zero, and a value like 12:30 may be read as a number. This checker follows the newer YAML 1.2 rules, where those stay as text. If the tool that will read your file still uses YAML 1.1, put quotes around such values.

Why not convert to JSON and back?

That is a common way to tidy YAML, but it discards every comment and can reorder keys. Configuration files are usually full of comments explaining why a value is what it is, so this tool reformats the document in place instead. If you do want the data as JSON, use YAML to JSON, andJSON to YAML for the other direction.

Sorting keys

Sorting keys alphabetically at every level makes two versions of a file easy to compare, which helps when reviewing changes to a long configuration. Leave it off when order carries meaning to a reader, such as the steps of a workflow. List items are never reordered, because their order almost always matters.

Frequently asked questions

Why does YAML break so easily?

YAML uses indentation to mean structure, so a single misplaced space changes what a file means, and a tab breaks it entirely. Most errors come down to indentation, a missing colon, or a value that needs quotes.

Are my comments kept when it reformats?

Yes. Comments, including ones at the end of a line, are preserved, and so is the order of your list items. That is the main reason to tidy YAML here rather than converting it to JSON and back, which throws comments away.

What does "duplicate key" mean?

The same key appears twice in one block. YAML quietly keeps only the last one, so a setting you think you changed may be silently ignored. This tool reports it as an error rather than letting it pass.

Why should I be careful with values like "no", "on" and "1.10"?

In older YAML 1.1 tools, no and on become false and true, and version numbers like 1.10 can turn into 1.1. This checker follows YAML 1.2, where they stay text, but if your tool uses 1.1, wrap such values in quotes to be safe.

Is my file uploaded?

No. The YAML is checked and reformatted in your browser, so configuration files with hostnames, keys or internal names never leave your device.

Last updated

Missing a feature, or need a tool we don’t have? Suggest it.