{
"color": "red",
"count": 2
}This page converts, and the direction is a control. Conversion defaults to to-json. color: red and count: 2 becomes a JSON object with color red and count 2. Switch to from-json and {"greet":"hello"} becomes greet: hello followed by a newline. Numbers stay numbers. The formatter page only reprints YAML and will not produce this object.
The YAML parser’s errors surface as the message, so a bad indent fails rather than becoming a JSON string of the raw text. Alias expansion is capped, same as the formatter. From-json parses JSON first, so a trailing comma or a bare key fails as JSON, not as YAML.
One document at a time. A YAML stream of several documents is not what to-json is aimed at. If you need the data loaded into SQL, the JSON to SQL page takes the array you get after you have shaped it.
to-json of color: red and count: 2. from-json of {"greet":"hello"}.
JSON: { "color": "red", "count": 2 }. YAML: greet: hello
Direction is explicit. A page that guesses from the first character will misread a JSON string that happens to be valid YAML.
With to-json, an object { "color": "red", "count": 2 } when count is the second key. The number 2 stays a number.
{"greet":"hello"} with from-json becomes greet: hello and a trailing newline.
The formatter reprints YAML. It does not offer to-json or from-json.
Paste one document. A multi-document stream is outside what this control does.