Orpheus

YAML to JSON

For the common subset — config files, not the whole spec.

Options
Indent the output
Result

Everything is processed in this tab. Nothing you paste is sent anywhere.

Every tool runs entirely in your browser. Your files are never uploaded to a server.

YAML and JSON describe the same data. YAML uses indentation and JSON uses braces, so converting means reading the indentation structure and writing it as nested objects and arrays.

How to use YAML to JSON Converter

  1. Paste your YAML. Comments and document markers are ignored.
  2. Read the JSON. Indented by default; the toggle produces a single line.

About converting YAML to JSON

YAML and JSON are two notations for the same underlying data model: scalars, ordered sequences and key-value mappings. JSON marks structure with braces and brackets, which makes it unambiguous and tedious to write by hand. YAML marks structure with indentation, which makes it pleasant to write and gives it an entire category of failure JSON does not have. Indentation-significant syntax means whitespace carries meaning, so a line indented two spaces instead of four changes what the document says rather than how it looks. This is why tabs are forbidden outright — a tab has no defined width, so the same file would parse differently depending on the editor. An editor configured to convert spaces to tabs on save will break a YAML file silently and produce an error that appears to be about something else. The other classic trap is implicit typing. YAML infers types from unquoted values, and in the widely implemented 1.1 revision the words yes, no, on and off are booleans. A list of country codes containing NO therefore becomes false, which is well known enough to have a name. Version 1.2 removed those aliases, but plenty of parsers still behave the old way, so quoting anything that could be mistaken for a boolean or a number remains sound practice — particularly version strings, where an unquoted 1.10 becomes the number 1.1.

Frequently asked questions

Why does YAML reject tabs?
Because a tab has no defined width, so indentation-significant syntax cannot use it unambiguously. The specification forbids tabs for indentation entirely, and it is the most frequent YAML error — particularly when an editor converts spaces on save.
Is every YAML file valid JSON input?
Conceptually, since JSON is a subset of YAML. In practice YAML has features JSON has no equivalent for — anchors and aliases, multiple documents in one file, explicit type tags, and multi-line block scalars — and those need a decision about how to represent them rather than a direct translation.
What is the Norway problem?
In YAML 1.1, the unquoted value "no" parses as boolean false, so a country list containing NO for Norway silently becomes false. YAML 1.2 removed the yes/no aliases, but many parsers still implement 1.1, which is why quoting ambiguous strings is a good habit.
Does this handle the whole YAML specification?
No, and it says so deliberately. It covers what configuration files actually contain: nested mappings, sequences, inline arrays, comments, quoted strings and the usual scalar types. Anchors, aliases, tags and block scalars are outside it.
Is my configuration uploaded anywhere?
No. The conversion runs in your browser, which matters because configuration files routinely contain host names, ports, internal paths and occasionally credentials that should not be pasted into an unknown server.

Last updated