What is YAML Viewer?

YAML Viewer lets you paste or upload YAML files and instantly see a formatted, syntax-highlighted tree view. It validates your YAML against the spec, highlights errors with line numbers, and lets you collapse or expand nested sections to navigate large config files quickly.

It supports multi-document YAML (split by ---), preserves nested anchors, and reformats your input with configurable indentation (2 or 4 spaces). The tree view lets you click to collapse arrays and maps so a Helm chart or Compose file becomes scannable at a glance, and a built-in search highlights matching keys or values across the whole document. Errors land at a specific line and column so you can fix indentation without guessing.

How to use

  1. Paste your YAML content or drop a .yml/.yaml file into the editor area.
  2. The viewer instantly validates the syntax and highlights any errors with line numbers.
  3. Switch between tree view and raw view, collapse nested sections, and download the formatted output.

When to use

  • Validating a Kubernetes manifest before kubectl apply, to catch typos in apiVersion or selectors.
  • Eyeballing a long docker-compose.yml without scrolling through 300 lines of plain text.
  • Inspecting an Ansible playbook or GitHub Actions workflow to confirm the structure parses.

Result

You have a Kubernetes deployment manifest with 200+ lines. Paste it in to quickly validate all required fields are present, spot indentation errors, and navigate to the container spec section by collapsing other nodes.

FAQ

What's the difference between this and just running yamllint locally?
yamllint enforces style rules (trailing whitespace, line length) on the command line. This tool focuses on parsing and visualising structure — paste a file, see the tree, and download a cleanly formatted version with consistent indentation.
Does it handle YAML aliases and anchors (& and *)?
Yes. The js-yaml parser resolves anchors so the tree view shows the expanded value at the alias reference. The reformatted output drops the anchors and writes the resolved content inline, which is usually what you want for review.
Can I paste multiple YAML documents in one go?
Yes. Documents separated by --- are parsed as a stream, and the document count appears in the toolbar. The tree view stacks them with a separator, so a Kubernetes manifest containing a Deployment and a Service is easy to compare side by side.
Why does the line number in the error not match my editor?
YAML parsers count lines from 1 starting at the first content line, while some editors number a leading shebang or comment differently. The column number is usually the more reliable hint — it points at the exact character that broke the parse.
Is the YAML I paste sent to a server?
No. The parser and formatter run locally on your device, so secrets like passwords or API keys you accidentally paste don't leave your machine. Still, treat any paste of production config as risky and redact before sharing screenshots.

Related Tools