Integers Beyond 2^53 in JSON — Silent Identifier Corruption (.json)
Six large integers written both as JSON numbers and as strings, including the 2^53 boundary where consecutive integers stop being distinguishable in a double. A parser backed by doubles turns 9007199254740993 into 9007199254740992 and reports no error at all.
{
"note": "JSON numbers have no width. Parsers that use a double lose every id above 2^53.",
"safe_integer_limit": 9007199254740991,
"records": [
{
"id_as_number": 9007199254740992,
"id_as_string": "9007199254740992",
"survives_double": true,
"value_after_double_round_trip": 9007199254740992
},
{
"id_as_number": 9007199254740993,
"id_as_string": "9007199254740993",
"survives_double": false,
"value_after_double_round_trip": 9007199254740992
},
{
"id_as_number": 9007199254740994,
"id_as_string": "9007199254740994",
"survives_double": false,
"value_after_double_round_trip": 9007199254740994
},
{
"id_as_number": 12345678901234567890,
"id_as_string": "12345678901234567890",
"survives_double": false,
"value_after_double_round_trip": 12345678901234567168
},
{
"id_as_number": 18446744073709551615,
"id_as_string": "18446744073709551615",
"survives_double": false,
"value_after_double_round_trip": 18446744073709551616
},
{
"id_as_number": 1234567890123456789,
"id_as_string": "1234567890123456789",
"survives_double": false,
"value_after_double_round_trip": 1234567890123456768
}
]
}
Specifications
- Records
- 6
- Safe Integer Limit
- 9007199254740991
- Largest Value
- 18446744073709551615
- Both Forms Present
- id_as_number and id_as_string
- Corrupted By Double Parsers
- 5
Testing contract
Expected to recover- Scenario
- Parse the file with your JSON library and compare each id_as_number against the matching id_as_string.
- Expected result
- A big-integer-aware parser keeps all six pairs in agreement; a double-backed parser disagrees on the four records above 2^53, matching the value_after_double_round_trip column instead.
What is a .json file?
JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format representing objects, arrays, strings, numbers, booleans, and null. It is language-independent, human-readable, and the dominant format for web APIs and configuration. It requires a single well-formed root value.
How to use this file
Use an example JSON file to test parsers and serializers, schema validation, Unicode and number-precision handling, and API request or response processing.
How to use this file for testing
“Integers Beyond 2^53 in JSON — Silent Identifier Corruption (.json)” is a deterministic Novus Examples fixture for Scientific data, Editor testing, Error handling. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.
Documented properties for this file: 6 records. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.
Code examples
import json
with open("int64-beyond-double-precision.json") as f:
data = json.load(f)
print(type(data), len(data))Related files
- jsonIEEE-754 float64 Boundary Values — JSON With No NaN Literal (.json)The same boundary values as strict RFC 8259 JSON, where non-finite numbers are null in the numeric field and text in the string field because the standard has no NaN or Infinity literal. It is the fixture for the encoder that emits bare NaN and produces JSON nothing else will parse.

- csvCensored Values and Detection Limits — Non-Numeric Results (.csv)Nine laboratory results where only four are plain numbers: two are below the detection limit, one is above range, two are missing in different spellings, and one is a legitimate small negative near the blank. Coercing the censored strings to numbers or to NaN both bias the summary, and the file distinguishes every case explicitly.

- cifCIF Parser Edge Cases — Quotes, Text Fields and Wrapped Loops (.cif)A CIF built entirely out of the constructs that break naive parsers: quoted values containing apostrophes and hashes, a semicolon-delimited multi-line text field, the distinct '?' and '.' markers, a standard uncertainty written as 1.2345(7), and a loop whose rows wrap across lines. Every one of them is legal CIF.

- fastqIntentionally Corrupt FASTQ — Final Record Missing Its Quality Line (.fastq)An intentionally corrupt FASTQ whose first five records are complete and whose sixth ends after the plus line, leaving no quality string. A four-line-block reader must report an incomplete final record rather than pairing the sequence with an empty quality string.

- mtxIntentionally Corrupt Matrix Market — Declared Count Exceeds the Entries (.mtx)An intentionally corrupt Matrix Market file whose banner and size line are perfectly valid and whose entry block stops seven lines short of the declared count. A reader that preallocates from the declared count and never checks ends up with seven silent zeros.

- molIntentionally Corrupt Molfile — Counts Line Disagrees With the Atom Block (.mol)An intentionally corrupt molfile whose counts line declares twelve atoms while the atom block contains nine, so a parser reading by count consumes three bond lines as atoms. Everything else about the file is well formed, which is what makes the failure quiet.

Generated by generation/scientific.py. Free for any use, no attribution required — license.