JSON number precision: avoid changing large IDs

JavaScript numbers use binary floating point. Integers above 9,007,199,254,740,991 are not guaranteed to remain exact.

JSON.parse('{"id":9007199254740993}').id
// 9007199254740992

Preserve identifiers as strings

{"id":"9007199254740993"}

If you control the API, serialize opaque identifiers as strings. If you cannot change the API, use a lossless JSON parser or preserve the original response. Do not use ordinary parse-and-stringify formatting for financial decimals or large integer identifiers when exact representation matters.

Our free formatter and minifier validate syntax and preserve original numeric tokens, string escapes and duplicate keys. They do not resolve duplicate keys or perform arithmetic. Try them with non-sensitive sample data.

Open free developer tools ยท JSON inspection guide