Boneyard Tools

YAML Formatter and Validator

Paste YAML to clean up the indentation, normalize the style and validate the syntax. Choose your indent, sort keys, and spot errors instantly.

How to format YAML

  1. Paste or type your YAML into the editor.
  2. Pick the indentation you want and toggle key sorting on or off.
  3. Copy the formatted YAML or download it as a .yaml file.

Examples

Normalize messy YAML

{ name: Ada, skills: [math, logic] }
name: Ada
skills:
  - math
  - logic

Frequently asked questions

Does this validate YAML too?

Yes. The YAML is parsed before it is reformatted, so any syntax error, such as bad indentation or a missing value, is reported with the parser's message.

Is my YAML uploaded anywhere?

No. Formatting and validation run entirely in your browser, so your YAML never leaves your device.

What does formatting actually change?

It rewrites the document in a consistent block style with even indentation, converts inline flow syntax to block form, and removes stray blank lines, without changing the underlying data.

Can I sort the keys?

Yes. Turn on key sorting to order mapping keys alphabetically at every level, which makes diffs and reviews easier to read.

What happens to comments and anchors?

Comments are dropped because they are not part of the parsed data. Anchors and aliases are resolved, so the output contains the fully expanded values.

Which indentation should I use?

Two spaces is the common default and works well for most files. Four spaces gives more visual separation for deeply nested structures.

Learn more

Related tools