JSON has six value families and string-only object member names. YAML can express a wider graph and tag model, so reliable conversion begins by deliberately choosing the JSON-compatible subset.
Collections keep order and shape
A JSON object becomes a YAML mapping with the same string keys in source order. An array becomes a sequence in the same order. Empty object and array stay visibly distinct as {} and []. JSONYAML never sorts members or turns an array into a keyed map.
Scalar spelling can matter
Strings and keys use JSON-compatible double quotes in generated YAML, which prevents words such as true or null from changing type. JSON number lexemes, including large integers and exponent forms, are emitted directly instead of being rounded through JavaScript Number.
The destination parser is authoritative
Keep the original, diff the complete output and parse the result with the exact library or application that will consume it. JSONYAML proves only that one bounded document fits its declared JSON-compatible profile. It does not validate a destination schema, environment substitution, application defaults, deployment behavior or semantic correctness.