All developer tools

YAML Tools

Validate, format, and compare YAML files. Convert YAML to JSON or split and merge multi-document files.

YAML is common in configuration files because nested mappings are readable and comments can explain decisions. That convenience also creates subtle errors: indentation changes structure, a tab is not the same as spaces, and scalar interpretation can differ between parser versions. Use the validator to check the document you have, then inspect how a target system will interpret its values. A local formatter is useful for consistency but should be checked against comments and anchors before replacing a source file.

The tools here cover different stages of a configuration review. Formatter expands collections into readable blocks, Diff compares parsed values, and Multi-doc YAML handles streams separated by document markers. YAML to JSON reveals the data shape after parsing, which is particularly helpful when an application expects an object but receives an array or a string. Minifier deliberately favors compact flow style; it is a different task from making a manifest easier to review.

Choose the right tool

  • YAML Validator: Catch indentation and syntax errors before applying a manifest.
  • YAML Diff: Compare configuration values when line wrapping and key order are distracting.
  • Multi-doc YAML: Separate a stream of resources when one file contains several YAML documents.

A practical workflow

Before changing a Kubernetes manifest, validate the original file and the edited file separately. Format each to make nested keys readable, then use YAML Diff to focus on data changes. If the file contains several resources, split it with Multi-doc YAML and check the resource you meant to edit. Finally, convert a small representative document to JSON if your deployment system consumes a parsed object and you need to verify the resulting types.

Things to check

  • YAML 1.1 and YAML 1.2 disagree on plain words such as yes and no. Quote values that must remain strings across toolchains. See YAML Validator.
  • Anchors, aliases, and comments are part of the source document. Check their placement after formatting rather than assuming every serializer keeps them. See YAML Formatter.
  • A document separator starts a new resource. It is not an indentation fix for a mapping that should stay in one document. See Multi-doc YAML.