What it does
Converts between YAML and JSON in both directions as you type. YAML → JSON parses YAML — nested maps, sequences, and anchors/aliases, which are resolved into plain values — and prints indented, two-space JSON. JSON → YAML parses the JSON and re-emits it as YAML, dropping quotes and braces where YAML allows. If either input is malformed, the parser's error message (with the line it choked on) is shown instead of a result.
How it works
Parsing is done with the js-yaml library in your browser. YAML and JSON describe the same data model — maps, lists, strings, numbers, booleans and null — so conversion is a parse into that model followed by a serialise into the other syntax. JSON is in fact a strict subset of YAML, which is why valid JSON also parses cleanly in the YAML direction.
Worked example
This YAML:
name: Ada
roles:
- admin
- editor
becomes { "name": "Ada", "roles": ["admin", "editor"] }. Switch mode and paste that JSON back to get the original YAML.
Gotchas
- Comments are lost. JSON has no comment syntax, so any
#comments disappear on a YAML → JSON round trip. - One document at a time. A YAML stream split with
---into multiple documents is not accepted — convert each document separately. - Indentation must be spaces. YAML forbids tabs for indentation; a stray tab produces a parse error.
- Anchors (
&x) and aliases (*x) are expanded, so the JSON contains the resolved value, not the reference.
When to use it
Reading a Kubernetes manifest, Docker Compose file, GitHub Actions workflow or any app config in whichever syntax you find easier, or feeding YAML-only config into a JSON-only tool. For pretty-printing or validating the JSON side, use JSON Formatter; for tabular data see CSV ↔ JSON, and to turn the JSON into interfaces see JSON to TypeScript & Go.
Privacy
Conversion runs locally in your browser; nothing you paste is uploaded.