Category: Developer tools

YAML Formatter

System ideaMissing a tool?

Format, re-indent and validate YAML in your browser

Format YAML with consistent indentation, optionally sort mapping keys alphabetically, and catch syntax errors as you type. Parsed and rewritten entirely in your browser.

Formatted YAML
The result will appear here.

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

YAML is sensitive to whitespace, so a file that's hand-edited or copied between tools often ends up with inconsistent indentation. This tool parses the document and rewrites it with a chosen indent width, catching any syntax error along the way and reporting where it happened.

How to use it

  1. Paste your YAML.
  2. Choose 2- or 4-space indentation, and whether to sort keys.
  3. Copy the reformatted YAML, or read the error if it doesn't parse.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

Does this convert YAML to JSON?
No — the output stays YAML. Use the YAML to JSON tool if you need the JSON representation instead.
Will sorting keys change what the file means?
Not for a plain mapping — key order in a YAML map is not meaningful to most parsers. It can matter for tools that read ordered keys by convention, so check before sorting a file another tool depends on.
Does it support multiple documents in one file?
The formatter reads the first YAML document in the input; a file with multiple --- separated documents should be split before formatting each one.