YAML prettify and format

Prettify your YAML string into a friendly, human-readable format.

About YAML prettify and format

Re-formats a YAML document with consistent indentation, optionally sorting the keys of every mapping. The document is parsed and written back, so the output is valid, canonical YAML.

When you would use it

How to use it

  1. Paste the YAML into the input field.
  2. Set the indent size (1 to 10 spaces) and toggle "Sort keys".
  3. Copy the formatted output.

Things worth knowing

Frequently asked questions

Why did my comments disappear?
YAML comments are not part of the data model, and the formatter works on the parsed data. Keep a copy of the original if the comments matter, or re-add them after formatting.
Is this the same as the YAML to JSON converter?
They share the parser, but this tool writes YAML back out while the converter writes JSON. Use this one when the result must stay YAML.

All the tools