Did formatting change your order ID? Check large JSON numbers and duplicate keys
A formatting step can change a number or discard a value if it parses the JSON first. We ran the same input through this site’s formatter and JSON.parse to compare the results.
Two things to look for
The example contains a long order ID and two keys named status. Not every long number is a problem, but this ID falls outside JavaScript’s safe integer range. Duplicate key names can also produce different results in different programs.
Formatting is not the same as parsing
Our JSON formatter adjusts whitespace and line breaks while preserving the original number spelling and key order. In this example, the final digit 3 and both status entries remain. Parsing the input with JSON.parse and then printing it with JSON.stringify changes the final digit to 2 and keeps only the last status.
Fix the source data first
For identifiers that are not used in calculations, such as order IDs, it is safer to send strings. Resolve duplicate status values according to your application’s rules. A formatter displaying both values does not mean your server will retain both. Formatting cannot recover a number that has already changed; compare it with the original.
What we tested
These results come from running the input below through the site’s actual JSON formatter and JavaScript’s JSON.parse. They are not a claim about every JSON tool. Section 4 of RFC 8259 recommends unique member names; section 6 discusses the integer range on which implementations can agree exactly.
Input to try
{"order_id":9007199254740993,"status":"pending","status":"paid"}Output from this site’s JSON formatter
{
"order_id": 9007199254740993,
"status": "pending",
"status": "paid"
}Output of JSON.stringify(JSON.parse(input), null, 2)
{
"order_id": 9007199254740992,
"status": "paid"
}Example source correction: a string ID and one status
{"order_id":"9007199254740993","status":"paid"}This example assumes paid has been confirmed as the correct status. The tool cannot make that decision for you.