What are the most common YAML syntax errors?
Tabs instead of spaces, incorrect indentation depth, missing space after colon (key: value), unquoted special characters at the start of scalars ({ [ @ | > : & * # ?), and duplicate keys that parsers may silently overwrite.
Can YAML use tabs for indentation?
No. YAML explicitly prohibits tab characters for indentation. Configure your editor to use spaces (usually 2 per level for Kubernetes). This formatter converts tabs to spaces when you click Format YAML.
What is the difference between YAML and JSON?
JSON is a strict subset of YAML 1.2—all valid JSON is valid YAML. YAML adds comments (#), multi-line strings (| and >), anchors and aliases (&anchor, *alias), and less punctuation. YAML suits human-edited configs; JSON suits machine APIs.
Why does YAML sometimes interpret numbers and booleans unexpectedly?
YAML 1.1 treats yes/no/on/off and unquoted NO as booleans or null in some parsers. YAML 1.2 tightened rules but legacy tooling remains. Quote values that must be strings: 'yes', 'NO', '0744'.
Does this tool validate Kubernetes manifests?
It validates YAML syntax (parseable structure) only—not Kubernetes apiVersion/kind schemas. Use kubectl apply --dry-run=server or kubeconform after formatting for schema checks.
How do I format YAML with 2 vs 4 spaces?
Use the Indent 2 or Indent 4 controls in the toolbar before Format YAML. Prettier applies your chosen tab width consistently across the document.
Can I convert YAML to JSON here?
Yes—use More → Copy as JSON after formatting. The tool parses YAML to an object tree, then copies pretty-printed JSON. Fix syntax errors first; very large files may hit browser limits.
Is my YAML uploaded to a server?
No. Formatting and validation run in your browser. Optional localStorage saves your last session on this device. Share links encode YAML in the URL—avoid sharing secrets.
What is strict validation mode?
Strict mode adds non-blocking hints for duplicate keys and risky unquoted scalars. It does not block formatting—it helps catch issues parsers may accept but applications mishandle.
How is this different from Prettier on the command line?
Prettier CLI is ideal for CI and pre-commit hooks. This browser tool adds paste-and-fix workflow, line-level error UX, jump-to-line, JSON export, diff view, sort keys, and share links without local Node setup. Files over 80k characters format in a background worker.
Can I sort YAML keys alphabetically?
Yes—use More → Sort keys A–Z. Keys are sorted recursively at each mapping level; list order is preserved. Multi-document files keep --- separators. Run Format YAML afterward if you want Prettier spacing on the sorted result.