What property holds the maximum safe integer in JavaScript?

The story behind the answer

The JavaScript property holding the maximum safe integer is `Number.MAX_SAFE_INTEGER`.

Its value is 9,007,199,254,740,991, equal to 2^53 − 1. “Safe” means every integer up to that positive limit, and down to its negative counterpart, can be represented exactly and compared reliably using JavaScript’s ordinary `Number` type.

JavaScript numbers use IEEE 754 double-precision floating-point format. Although the format can represent values far beyond this limit, it cannot preserve every individual integer once the available precision is exhausted. For example, `Number.MAX_SAFE_INTEGER + 1` and `Number.MAX_SAFE_INTEGER + 2` compare as equal in JavaScript. The related `Number.MAX_VALUE` is much larger, but it means the largest finite numeric magnitude, not the largest precisely represented integer.

For exact integer arithmetic beyond the safe range, JavaScript provides `BigInt`, written with an `n` suffix, such as `9007199254740993n`. The companion property `Number.MIN_SAFE_INTEGER` gives the negative limit, and `Number.isSafeInteger()` checks whether a value is safe.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: