How standard libraries read JSON files

9 JSON files given to 4 readers in 13 runtime versions. Cells of the ordinary files: reads 78, differs 0, refuses 0, crashes 0. How this is measured. The results as JSON.

JSON files, by reader
FileThe manifest says Go encoding/json adapter Node.js JSON adapter Python json adapter Ruby JSON adapter Java
The standard library has no JSON parser.
edge/json-bom.json 80 B
edge file: readers differ, and none is wrong
nothing to compare

1.26 refuses with json.SyntaxError: invalid character 'ï' looking for beginning of value

1.27 refuses with json.SyntaxError: invalid character '\ufeff' looking for beginning of value

refuses with SyntaxError: Unexpected token '', "{

refuses with json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

3.3 to 3.4 refuses with JSON::ParserError: unexpected token at '{

4.0 refuses with JSON::ParserError: unexpected character: '{' at line 1 column 1

no-reader
edge/json-trailing-comma.json 64 B
edge file: this file is meant to be refused
nothing to compare

refuses with json.SyntaxError: invalid character ']' looking for beginning of value (expected)

refuses with SyntaxError: Unexpected token ']', ..."e", "two",], (expected)

3.11 to 3.12 refuses with json.decoder.JSONDecodeError: Expecting value: line 4 column 25 (char 59) (expected)

3.13 to 3.15 refuses with json.decoder.JSONDecodeError: Illegal trailing comma before end of array: line 4 column 24 (char 58) (expected)

3.3 to 3.4 refuses with JSON::ParserError: unexpected token at '], (expected)

4.0 refuses with JSON::ParserError: unexpected character: '],' at line 3 column 25 (expected)

no-reader
edge/zero-byte.json 0 B
edge file: this file is meant to be refused
nothing to compare

refuses with json.SyntaxError: unexpected end of JSON input (expected)

refuses with SyntaxError: Unexpected end of JSON input (expected)

refuses with json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) (expected)

3.3 to 3.4 refuses with JSON::ParserError: unexpected token at '' (expected)

4.0 refuses with JSON::ParserError: unexpected end of input at line 1 column 1 (expected)

no-reader
json/10mb.json 10 MB (9,996,549 bytes) items 19368, top_type array

reads reports items 19368, top_type array

reads reports items 19368, top_type array

reads reports items 19368, top_type array

reads reports items 19368, top_type array

no-reader
json/1mb.json 997.7 KB (997,720 bytes) items 1942, top_type array

reads reports items 1942, top_type array

reads reports items 1942, top_type array

reads reports items 1942, top_type array

reads reports items 1942, top_type array

no-reader
json/all-types.json 708 B items 21, top_type object

reads reports items 21, top_type object

reads reports items 21, top_type object

reads reports items 21, top_type object

reads reports items 21, top_type object

no-reader
json/nested-100-levels.json 1.4 KB (1,380 bytes) items 1, top_type object

reads reports items 1, top_type object

reads reports items 1, top_type object

reads reports items 1, top_type object

reads reports items 1, top_type object

no-reader
json/people-10.json 5.2 KB (5,186 bytes) items 10, top_type array

reads reports items 10, top_type array

reads reports items 10, top_type array

reads reports items 10, top_type array

reads reports items 10, top_type array

no-reader
json/people-1000.json 512.7 KB (512,687 bytes) items 1000, top_type array

reads reports items 1000, top_type array

reads reports items 1000, top_type array

reads reports items 1000, top_type array

reads reports items 1000, top_type array

no-reader

None of the 4 readers, in 4 runtimes, read edge/json-bom.json. Its outcome, varies, is what the format allows, not what these readers did.

The JSON files themselves, and the measured properties each row is compared with: JSON sample files.