YAML Viewer

Web

View YAML as a collapsible tree and catch indentation errors by line number. Parses scalars, sequences, mappings, anchors and aliases locally in your browser.

Valid · 11 nodes
YAMLInput
TREEStructure
(root)4
app:"example"
version:1
servers2
[0]2
host:"a.com"
port:80
[1]2
host:"b.com"
port:443
active:true

About YAML Viewer

YAML expresses hierarchy purely through indentation, so the longer a file gets, the harder it becomes to tell which level a given key sits at — the classic source of subtle config bugs. This tool parses YAML and renders it as a collapsible tree locally in your browser, making nesting, sequences, mappings, and anchor references immediately visible, with type colouring for strings, numbers, booleans and nulls. Because indentation is so load-bearing in YAML (siblings must align and tabs are forbidden), a tree view is ideal for diagnosing exactly how many levels deep a key really is. A filter matches keys and values, temporarily ignoring collapsed state and highlighting the hits, so you can jump straight to a key in a big Kubernetes manifest, CI workflow, or docker-compose file. Everything is read-only and processed locally, so nothing about your config is uploaded.

Facing several hundred lines of YAML, checking visually whether a key sits at the right depth is unreliable, especially with inconsistent indent widths or block scalars. A viewer parses the configuration into a collapsible tree, turning "which section does this key belong to" into something visible at a glance, and pins parse errors to a line and column, removing the guesswork.

Parsing builds an object tree from indentation, so consistency is the entire premise: mixing tabs and spaces, or varying the indent width of siblings, either fails the parse or produces a structure that contradicts intuition. Error messages usually give a position without an explanation, because the parser cannot tell what the author intended, which is why these reports are commonly seen as cryptic.

Practical notes: When a parse fails, replace tabs with spaces first and configure the editor to show whitespace, and most problems appear immediately. Then check block scalar indentation: the pipe form preserves newlines and indentation while the greater-than form folds them into spaces, and the two have different requirements relative to following content, so a mistake silently changes the value instead of erroring. While expanding the tree, watch the nesting depth, since excessive depth usually means one indent level too many.

Limits: A viewer displays and does not validate: a missing required key, a misspelled field name or an out-of-range value all pass without complaint, so "it renders" is not "it is correct". Duplicate keys are also handled inconsistently, with some parsers letting the last win and others erroring outright, so avoid duplicates and add that check to automation. Anchors and aliases appear expanded, which easily misleads a reader into thinking content really is repeated many times.

Data and privacy: configuration needing review usually holds secrets and connection strings. This tool parses and displays in the browser, uploads nothing and works offline. For production configuration, copy it and replace sensitive values before analysing the structure here.

How It Works Internally

The viewer parses text into a tree by indentation, so consistency is the entire premise: mixing tabs and spaces, or varying sibling indentation, fails the parse or produces a structure that contradicts intuition. Error messages give a position rather than an explanation, since the parser cannot tell what the author intended. Anchors appear expanded, so content looks repeated.

Inputa:\n b: 1\n c: 2
OutputSibling b and c use different indentation → the parse fails or c lands at the wrong level, and the error names only the line

Measured on This Page

Tab indentation errortab characters must not be used in indentation (2:1) — line number points at the Tab
Duplicate keysduplicated mapping key (2:1): a hard error, not a silent overwrite
js/function injectionunknown tag !<tag:yaml.org,2002:js/function> — the dangerous tag is rejected (js-yaml default schema excludes it)
Offline parsingPasting under DevTools offline still expands correctly (3-line sample)
Google, last 90 days22 clicks / 98 impressions / CTR 22.4%
Tree view (measured 2026-11-03)Collapse all cuts visible rows 11→1 and expand restores them; filtering "port" highlights 2 rows and an empty match shows the no-match hint

The parser is js-yaml, and its error line numbers point at the line that actually breaks — which is often not the line your eye assumes: the Tab-indentation error (2:1) points at line 2, column 1, and duplicate keys point at the second occurrence. Both frequent errors carry exact row:column marks, so reading the badge against the indicated line beats guessing line by line.

How this was measured: Injected samples into the page's CodeMirror via CDP real keyboard events (click to focus → Ctrl+A → delete → type), then read the error badge text and the output pane; offline scenarios repeated the same flow under DevTools offline. Reproducible via scripts/audit/evidence/batch1_yaml_obfuscator.py. · Measured 2026-10-28

How to Use

  1. Open "YAML Viewer"
  2. Paste YAML into the editor on the left
  3. The right pane renders a collapsible hierarchy tree
  4. Filter by key or value to highlight matching rows
  5. An indentation error shows up in the status bar
  6. "Copy JSON" exports the equivalent structure

Use Cases

  • Review K8s manifests — Render verbose Deployment/Service YAML as a tree to verify each level of config fast.
  • Understand CI config — Expand GitHub Actions / GitLab CI YAML to see the job and step hierarchy clearly.
  • Debug indentation — When YAML misbehaves, use the tree view to confirm which level a key is indented under.
  • Inspect anchors — See the actual expanded structure of YAML anchors and references.
  • Browse large configs — Collapse irrelevant sections to focus on the target config block.
  • Audit Helm values — Render a Helm values.yaml as a tree to quickly confirm every nested override is at the correct depth.
  • Trace Docker Compose — View the full docker-compose service hierarchy collapsed to trace depends_on chains and volume mounts.

FAQ

Does it support multi-document YAML?

Yes. Multiple documents separated by --- are parsed individually and shown as separate blocks in the tree.

How are anchors and references shown?

The tool expands anchor references so you see the full effective content at the reference site.

Does it modify my YAML?

No. It only parses and renders read-only, leaving the original content unchanged.

Why does parsing fail?

Usually inconsistent indentation or mixed tabs. YAML is very indentation-sensitive; the error helps you locate it.

Can I search within collapsed nodes?

Yes. Search temporarily ignores collapsed state and highlights matching keys or values so you can locate the entry directly.

Want to view as JSON?

Use the YAML to JSON tool, then browse with the JSON Viewer.

It complains about TAB indentation but I cannot see any tabs?

YAML forbids TAB indentation and tabs look identical to spaces in most editors. Enable "show whitespace" to find them; YAML copied from chat apps or web pages is the usual source. Select-all and replace tabs with spaces is the fastest fix.

Arrays show as [0], [1] indices in the tree — is that right?

Yes. List items are displayed by index in the tree, same as JSON arrays. The underlying data is a real array; copying or exporting emits a standard array without those index prefixes.