YAML to JSON converter

Paste YAML to get formatted JSON. Errors point to the line number. See the supported subset below.

Supported YAML subset

The YAML reader handles what most config files use: nested mappings by indentation, block lists (- item), lists of mappings, plain, single- and double-quoted scalars, numbers, true/false, null/~, comments, | and > block scalars, and JSON-style flow collections such as [1, 2].

Not supported: anchors and aliases (&, *), tags (!!str), multiple documents in one stream, complex keys and YAML 1.1 booleans like yes/on (they stay strings, as in YAML 1.2). For those files use a full YAML library.

Worked example

ports:
  - "8080:80"
→ {"ports": ["8080:80"]}

Quoting "8080:80" matters: unquoted, YAML 1.1 parsers read 22:22 as a base-60 number (1342).

Frequently asked questions

Why did my value become a string instead of a boolean?
Only true and false are booleans here (YAML 1.2). yes, no, on and off stay strings.
Does it support anchors (&default)?
No. Expand anchors manually or use a full YAML library for such files.