Convert YAML to JSON (and back).
YAML is a superset of JSON — anything in JSON is valid YAML. Going the other direction loses information in specific cases. This guide covers the round-trip cleanly.
Straight flow
- Open /yaml/. Paste YAML into the left pane.
- Click "→ JSON." Output appears in the right pane, formatted.
- Reverse: click "← YAML" with JSON on the left. Choose 2- or 4-space indent.
- Sort keys or Validate without converting — buttons above the panes.
Type gotchas
YAML has a richer type system than JSON. What survives a round-trip and what doesn't:
Booleans
YAML accepts true, false, yes, no, on, off as booleans — and famously interprets the country code NO in a list as boolean false. JSON only has true/false. The tool normalizes on convert. If your source has no: something as a country code, quote it: "NO": something.
Integers
Both formats represent integers. But YAML allows 0o755 (octal), 0xFF (hex), and 1_000_000 (underscore separators). JSON allows only base-10 integers with no separators. On convert, the tool decodes to base-10.
Nulls
YAML nulls are any of: null, ~, empty value, or Null. JSON has one: null. Round-trip preserves the value but not the specific YAML spelling.
Dates
YAML has a native date type: 2026-08-28. JSON has no date type — dates round-trip as strings. If you need to preserve date-ness across YAML→JSON→YAML, you'll need to re-annotate on the way back.
Anchors and aliases
YAML anchors (&anchor) and aliases (*anchor) let one node reference another. JSON doesn't. On convert, the tool expands aliases to the referenced value — reasonable for most cases but loses the reference intent.
Multi-document files
A single YAML file can hold multiple documents separated by ---. JSON has no equivalent. The tool converts the first document; subsequent documents are dropped with a warning.
Common use cases
- Kubernetes manifests — YAML→JSON for scripts that need to parse without a YAML lib (jq is native to most CI images; yq is not).
- GitHub Actions — YAML source, but sometimes debugging is easier as JSON.
- Docker Compose — same as above.
- OpenAPI specs — often authored in YAML, consumed as JSON.
--- doc separator syntax to convert multiples in sequence. For scripting: curl -s file.yml | ... won't hit this browser tool, but the js-yaml library it uses is available as an npm/CLI package.What about TOML, XML?
/toml/ and /xml/ ship the same bi-directional flow — TOML ↔ JSON and XML ↔ JSON. Same UI, same guarantees.