Skip to main content
${format:vault}

YAML Formatter

Input
Tab inserts an indent. Press Escape, then Tab, to move focus out of the editor.
Output

Why use a private YAML formatter?

YAML is the lingua franca of infrastructure configuration — Kubernetes manifests, GitHub Actions workflows, Docker Compose files, Ansible playbooks. These files often contain environment variable names, internal hostnames, and secret references that should not leave your environment.

formatvault validates and reformats YAML using js-yaml, entirely in your browser. Your config files never touch an external server. Line-level error messages pinpoint exactly which line caused the parse failure so you can fix it quickly.

How it works

js-yaml parses your input into a JavaScript object tree, then re-serializes it with consistent indentation and block scalar style. Multi-document YAML (files with --- separators) is handled as separate documents, each formatted independently.

The tree view renders the parsed structure as a collapsible node tree, letting you navigate deeply nested configs without scrolling. The diff view compares your original and formatted output side by side so you can see exactly what changed.

Common use cases

  • Validating Kubernetes manifests and Helm chart values before applying to a cluster
  • Formatting GitHub Actions workflow files with consistent indentation
  • Debugging Docker Compose files that fail to parse with obscure error messages
  • Normalising indentation in Ansible playbooks (2 vs 4 spaces)
  • Inspecting multi-document YAML files (--- separated) from CI/CD pipelines
  • Comparing two versions of a config file with the built-in diff view
  • Exploring deeply nested Terraform variable files using the tree view

Frequently asked questions

Is it safe to format Kubernetes secrets or environment configs here?
Yes. js-yaml runs entirely in your browser — your YAML content is never sent to any server. This is specifically designed for config files that contain sensitive references.
Why does my YAML fail to parse even though it looks correct?
YAML is whitespace-sensitive and has many subtle rules around tabs (not allowed for indentation), implicit types, and multi-line scalars. The error message will show the exact line number — common culprits are tab characters and unquoted strings that look like special types (e.g. yes, no, null, ~).
Does it support multi-document YAML?
Yes. Files with multiple documents separated by --- are supported. Each document is parsed and formatted independently.
Can I choose the indentation level?
Yes — 2 spaces, 4 spaces, or tabs. The output style (block vs flow for collections) is also configurable.
Does it work offline?
Yes, once the page has loaded. The js-yaml library is bundled with the app and requires no network access to parse or format YAML.

Related tools