Levels

There are 3 levels of JSON, from strictest to loosest:

  1. I-JSON
  2. JSON (ECMA)
  3. JSON5
  1. I-JSON RFC 7493
    1. constrains encoding to be UTF-8
    2. constrains object members to be unique
    3. recommends big decimals encoded as string
    4. recommends binary data encoded as string using base64url
  2. JSON (ECMA, json.org)
    1. is a sequence of unicode code points.
    2. allows arbitrary length decimals
    3. prohibits non-numeric numbers (Infinity, NaN)
    4. does not require object member names to be unique.
  3. JSON5
    “is a superset of JSON that … [expands] its syntax to include some productions from ECMAScript 5.1
    It appears to exclude ECMAScript Reserved Words from allowed object member names, but relaxes the syntax to allow:
    1. single trailing commas in an object member list and array element list,
    2. single quoted strings,
    3.  // comments, /* multi
      line comments */,
    4. numbers to have
      1. leading plus, minus or no sign,
      2. 0x hexadecimal integer,
      3. Infinity and NaN,
      4. leading and trailing decimal points,

in addition, YAML is a superset of JSON. ie JSON is a strict subset of YAML.
However, “YAML primarily relies on outline indentation for structure”.