Developer & Text Tools

YAML Formatter & Validator

Validate and pretty-print YAML, convert YAML to JSON, or JSON to YAML. Errors point to the exact line, and anchors and merge keys are resolved.
Runs in your browserLive result

Workspace

Options

Writes nested values in flow style: [a, b].

How to use this tool

  1. 1Paste YAML (or JSON for the JSON → YAML mode).
  2. 2Pick the mode, indentation and key sorting.
  3. 3Fix any reported line, then copy or download the result.

Frequently asked questions

Both are the same string. The formatter quotes values that YAML would otherwise read as numbers, booleans or dates, so "007", "yes" and "2025-01-01" stay strings after formatting.

No. Formatting parses the YAML into data and writes it back, and YAML comments are not part of the data. Keep a copy if your file relies on comments.

Anchors and aliases are read correctly and expanded in the output. Files with several documents separated by --- are formatted document by document and kept separate; converting them to JSON gives one array.

No. Everything runs in your browser with JavaScript. The text you paste is not uploaded, logged or stored by MuhammadLab.