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.

Time: 30 secondsTool: /yaml/Uploads: None

Straight flow

  1. Open /yaml/. Paste YAML into the left pane.
  2. Click "→ JSON." Output appears in the right pane, formatted.
  3. Reverse: click "← YAML" with JSON on the left. Choose 2- or 4-space indent.
  4. 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

Bulk conversion. For a folder of YAML files that all need JSON, do it once by pasting the concatenation, or use the --- 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.

Do it now

Open the tool in a new tab. Nothing uploads.

→ Open /yaml/