YAML Formatter
?
About YAML formatting
- What exactly does Format do?
- It parses the input as YAML (JSON is also valid YAML, so pasting JSON works too) and re-serializes it as clean, consistently-indented block-style YAML. Line wrapping is disabled, so long strings and URLs aren't unexpectedly reflowed onto multiple lines.
- Does this handle anchors and aliases (&name / *name)?
- Yes — parsing and re-serializing both go through js-yaml, which resolves aliases into shared references when reading and re-emits anchors for any repeated structure when formatting back to YAML. The original anchor names aren't preserved (they're regenerated). One related feature isn't handled specially, though: a << merge key (used to blend a referenced mapping's keys into another mapping) is kept as a literal << key pointing at the referenced data, rather than being flattened into its sibling keys.
- Does this support multiple YAML documents separated by ---?
- No, only a single document at a time. Split a multi-document file at its --- separators and run each part through separately.
- Which values does this treat as booleans?
- Only true/false (and case variants like True or FALSE) parse as booleans. Unlike some older YAML tools, yes/no/on/off are kept as plain strings rather than coerced to booleans — but if a value like that appears unquoted in your input, formatting will still add quotes around it in the output, since an unquoted yes or no is ambiguous to some YAML readers.
- Does this tool upload my data anywhere?
- No. Parsing and formatting happen entirely in your browser via the bundled js-yaml library — no network calls. Nothing you paste ever leaves your device.
Pretty-print, validate, and convert YAML to JSON.
- input chars
- 0
- output chars
- 0
- status
- idle