YAML Formatter & Validator

Processed locally · Never leaves your browser

Format, validate, and convert YAML. Also converts between YAML and JSON. All processing is local.

Indent
Input (YAML or JSON)
Output

YAML Quick Reference

Mapping (object)
key: value
nested:
  a: 1
Sequence (array)
items:
  - apple
  - banana
Inline
{a: 1, b: 2}
[1, 2, 3]
String types
plain: text
quoted: "yes"
block: |
  line 1
Boolean / Null
active: true
value: ~
Anchors
base: &base
  key: val
child:
  <<: *base
Runs entirely in your browser — nothing is uploaded
Runs entirely in your browser. No uploads. Your files stay private.

What Is a YAML Formatter?

YAML (a recursive acronym for YAML Ain't Markup Language) is a human-readable data serialization format originally designed by Clark Evans, Ingy dot Net, and Oren Ben-Kiki. It is the standard configuration language for Kubernetes manifests, Helm charts, Docker Compose files, GitHub Actions workflows, GitLab CI pipelines, Ansible playbooks, Serverless Framework, CircleCI configs, and many more tools that need a config format friendlier than XML and more readable than JSON.
This formatter is built on js-yaml, a mature JavaScript port of the YAML 1.2 specification. yaml.load parses any input string into a JavaScript value (object, array, primitive); yaml.dump serializes that value back to canonical YAML with the indent and lineWidth options you choose. Errors throw with a YAMLException carrying the line and column of the failure, which the tool surfaces as the validation message.
Conversion between YAML and JSON is a round-trip through that same in-memory representation. yaml.load(input) parses YAML into JS objects, then JSON.stringify produces JSON. The reverse direction parses JSON.parse and feeds the result to yaml.dump. Because every JSON value is a valid YAML 1.2 value, JSON-to-YAML conversion is always lossless; YAML-to-JSON sometimes loses YAML-specific features like comments, anchors, and tagged types, which JSON cannot represent.
YAML's most famous footgun is the Norway problem. YAML 1.1 (still the version many tools use, including older js-yaml configurations) treats yes, no, on, off, y, n, true, false as booleans — including the case-folded variants. The two-letter ISO code for Norway is NO, so a country list like [NO, SE, FI] silently becomes [false, SE, FI]. js-yaml v4 defaults to YAML 1.2 which only treats true/false as booleans, but if you target tools running on YAML 1.1 you should always quote ambiguous strings.
Indentation is YAML's other classic pain point. The spec mandates spaces, never tabs, and the indent count must be consistent within a block. Two spaces is by far the most common convention; some teams use four. Mixing tabs and spaces, or accidentally indenting a list one space deeper than its parent map, produces parse errors that are sometimes far from the actual line you edited.
Anchors and aliases (& and *) let you reference a value defined elsewhere in the document, useful for sharing common configuration between Kubernetes resources or job definitions. Merge keys (<<: *base) compose maps; the merge-key feature was deprecated in YAML 1.2 but most tools still support it. js-yaml supports both. Multi-document streams (separated by ---) are also supported — useful when a single Kubernetes file declares multiple resources.
Security-wise, YAML's tagged types (!!python/object, !!ruby/object) have caused real-world remote code execution issues in libraries like PyYAML's yaml.load (use yaml.safe_load instead). js-yaml ships with a safe-by-default schema; the unsafe yaml.load with custom types is opt-in. This tool uses the default safe parsing path, so tagged types referencing language objects are rejected. Even so, treat unknown YAML files like any other untrusted input.
All processing happens locally. The js-yaml bundle is loaded once, the input lives in component state, and parsing and serialization run on the main thread without any network calls.

Common Use Cases

01

Kubernetes manifest review

Beautify and validate Deployment, Service, Ingress, and ConfigMap YAML before kubectl apply.

02

GitHub Actions workflow editing

Catch indentation errors and quoting issues in .github/workflows/*.yml before pushing.

03

Docker Compose tuning

Format docker-compose.yml so service ordering, port mappings, and volume mounts are easy to scan.

04

Helm values files

Validate values.yaml against expected structure and tidy nested overrides for chart templates.

Frequently Asked Questions

The YAML 1.2 spec explicitly prohibits tab characters for indentation because tabs render at variable widths in different editors, making the visual structure unreliable. Always indent with spaces; most editors can be told to insert spaces when you press Tab.
YAML 1.1 parsers treat yes, no, on, off as booleans. The country code NO for Norway gets coerced to false. YAML 1.2 fixes this by recognizing only true/false, but many tools still use 1.1. Always quote ambiguous values: "NO", "yes", "off".
Yes. JSON is a strict subset of YAML 1.2, so any valid JSON is already valid YAML. The JSON to YAML button parses the JSON and re-emits it in block style, which is more idiomatic and readable than inline JSON-style YAML.
YAML numbers are parsed as IEEE 754 doubles by default. Integers larger than 2^53 lose precision, just like JSON numbers. To preserve the exact value, quote the number as a string.
Anchors (&name) tag a value so it can be referenced later by alias (*name). They reduce duplication when the same block appears in multiple places. Merge keys (<<: *name) compose maps. js-yaml resolves all of these on parse, so the converted JSON is fully expanded.
Yes. The --- separator starts a new document within the same stream. Kubernetes uses this heavily to declare multiple resources in one file. js-yaml exposes loadAll for streams; the default load returns the first document only, which is what this tool currently uses.
By default with safe loaders (js-yaml's default, Python's yaml.safe_load), yes — the parser produces only plain data. Unsafe loaders that resolve language-specific tags (!!python/object) can execute arbitrary code and have caused historical CVEs. Stick to safe loaders for untrusted input.
Two block styles: literal (|) preserves newlines, folded (>) joins consecutive lines with spaces. Both have variants for trimming or preserving trailing newlines (|-, |+, >-, >+). Quoted strings can also span lines but require careful escaping.
1.2 is a stricter superset that aligns YAML with JSON, drops the yes/no/on/off booleans, narrows the int/float grammar, and clarifies edge cases. js-yaml v4+ defaults to 1.2; many older tools still use 1.1, so always quote ambiguous values.
No. js-yaml runs entirely in your browser. Parsing, formatting, and conversion happen on the main thread without any network requests, and nothing is logged or persisted.

Advertisement