Web Toolkit

YAML Formatter

Validate and reformat YAML, or convert it to JSON.

YAML

2
Input1 lines
Formatted YAML

Private by design. Everything runs locally in your browser. Your input is never uploaded, logged or stored on a server.

Frequently asked questions

What does this YAML formatter do?

It parses your YAML, validates it, and prints it back with normalised indentation and key ordering. Invalid documents are reported with the exact line and column.

Can it convert YAML to JSON?

Yes. Switch to the JSON tab to see the parsed document as formatted JSON, which is handy for checking how a parser interprets ambiguous values.

Why does my YAML fail with a tab error?

The YAML specification does not allow tab characters for indentation. Replace them with spaces — two per level is the common convention.

Is multi-document YAML supported?

Yes. Documents separated by `---` are parsed individually and reported together.

About the YAML Formatter

YAML is whitespace-significant, which makes it pleasant to read and easy to break. This tool parses your document, reports the line and column of any error, and re-emits it with consistent indentation and quoting.

Two classes of bug dominate. The first is tabs: YAML forbids them for indentation and the resulting error rarely mentions tabs. The second is the Norway problem — bare no, yes, on and off parse as booleans in YAML 1.1, so a country code list can silently turn NO into false. Quote such values.

The JSON output tab is useful for confirming what a parser actually sees, which is not always what the indentation suggests.

Related tools