Format messy YAML with canonical 2-space indentation, validate it with precise line-numbered errors, or convert it to JSON — and JSON back to YAML. Everything runs locally in your browser.
The parser covers the block style you meet in the wild: nested mappings and sequences by indentation, compact "- key: value" items, flow collections [a, b] and {k: v}, all scalar types, comments, and sequences at the same indent as their key. Anchors, aliases and multi-line literal blocks (| and >) are deliberately unsupported and reported as errors.
Frequently asked questions
Why do I get "multi-line quoted scalars are not supported"?
Quoted strings must close on the same line. Put the content on one line, or use a shorter value — literal | blocks are not supported either.
Tabs or spaces?
Spaces only. YAML forbids tabs for indentation; the parser treats a tab as part of the content and will flag it.
Does it support multiple documents in one file?
A single leading --- is accepted and ignored; further --- separators are not supported — split the file first.
中文说明
用规范的 2 空格缩进格式化杂乱的 YAML,带行号的精确报错校验,或与 JSON 双向互转。全部在浏览器本地完成。
解析器覆盖真实场景中的块级语法:按缩进嵌套的映射与序列、紧凑的 "- key: value" 写法、行内集合 [a, b] 与 {k: v}、全部标量类型、注释,以及与键同级的序列。锚点、别名与多行文本块(| 与 >)为刻意不支持,会明确报错。
常见问题
为什么提示"multi-line quoted scalars are not supported"?
引号字符串必须在同一行闭合。请把内容写在一行或缩短——多行文本块 | 同样不支持。
用 Tab 还是空格?
只能空格。YAML 禁止用 Tab 缩进,解析器会把 Tab 当内容的一部分并报错。
支持一个文件里多个文档吗?
仅接受并忽略开头的单个 ---;后续的 --- 分隔符不支持,请先拆分文件。