YAML Viewer

Pretty-print, validate, and inspect YAML documents with optional key sorting and anchor/alias expansion control.

Pretty-print, validate, and inspect YAML documents with optional key sorting and anchor/alias expansion control. Pretty-print, validate, and inspect YAML documents with optional key sorting and anchor/alias expansion control.

Array

        
    

Background

What YAML is and what makes a viewer useful

YAML ("YAML Ain't Markup Language") is a human-friendly data serialization format widely used for configuration files (docker-compose.yml, Kubernetes manifests, GitHub Actions workflows, Ansible playbooks, etc.). It trades the strictness of JSON for indentation-based structure and a richer type system that includes dates, multi-line strings, and references.

Because YAML relies on indentation to express nesting, a missing space can change the meaning of an entire document, and most editors do not visually highlight the hierarchy. A viewer parses the document and re-emits it with consistent indent, surfacing indentation mistakes at the same time it reveals the structure.

Features worth knowing

Most viewers let you toggle a few behaviours: sort keys alphabetically for stable diffs, expand or strip YAML anchors and aliases (the & / * syntax), and choose the indentation width. The sort option is particularly valuable when comparing two snapshots of the same configuration -- without it, key reordering between releases can mask real changes.

The byte-count and top-level-key stats help you see how heavy the document is and where the bulk lives. If you need to know whether your YAML fits inside an environment-variable limit or a Kubernetes ConfigMap size budget, that number is right there.

Workflow tips

When debugging a parse error, copy the document into a fresh viewer tab and toggle the options one at a time: an &anchor syntax may look like a typo until you see it expanded. For very long pipelines, use a 4-space indent to match common style guides; for inline review or chat pastes, 2-space is more compact. Always preserve the original document structure when committing configuration: a viewer is for inspection, not normalization.

Built around the MIT-licensed js-yaml library bundled in public/assets. Your input is parsed locally and never uploaded.

Frequently asked questions

Why does YAML look like JSON with extra steps?
JSON is a strict subset of YAML 1.2: every JSON document is a valid YAML document. YAML adds comments, multi-line strings, references, and a richer type system on top.
What is the difference between anchors (&) and aliases (*)?
An anchor (`&name value`) marks a value with a name; an alias (`*name`) re-uses that value elsewhere. The viewer can expand aliases inline (`*name` becomes the original value) or strip them, which is useful for normalizing output before commit.
Does the viewer preserve comments when re-emitting?
No. Most YAML libraries (including js-yaml) strip comments during a load/dump round-trip because YAML's data model does not include them. If comments matter, edit the original file directly.
Why does the viewer say it cannot find a tab character?
YAML does not allow tabs for indentation -- only spaces. Even a single tab inside a block scalar can confuse some parsers. Replace tabs with spaces and try again.
Will the viewer merge multi-document YAML files?
It parses and re-emits each document separately, but the current viewer emits a single document at a time. Use a multi-doc editor for those files.
Is my YAML uploaded?
No. Parsing and reformatting happen locally via the bundled js-yaml library; nothing leaves the browser.