json-tools .ru

YAML to JSON

Parses a YAML document and outputs the same data as JSON — useful when a config needs to go into code or an API that only understands JSON.

What counts as YAML

In auto-detect mode, YAML is only accepted if it's block-style (starts with a key, a list item, or ---), so JSON that happens to look YAML-ish isn't grabbed by mistake. Selecting the YAML input mode explicitly also accepts flow style ({a: 1}) and reports the exact line and column for any YAML syntax error.

What happens to types

YAML scalars true/false/null/numbers become JSON boolean/null/number, and plain strings stay strings in JSON's double-quoted form. YAML's # comments are dropped in the process — JSON has nowhere to keep them.

Format
YAML → JSON
Source text Paste text or upload a file
Result Type is not detected yet
Statistics appear after formatting