JavaScript (ES2026) reference · Number Methods and Properties
JavaScript Number.MAX_SAFE_INTEGER Property
The largest integer JavaScript numbers can represent exactly: 2^53 - 1, or 9,007,199,254,740,991.
JavaScript (ES2026) Since ES2015
Syntax
Number.MAX_SAFE_INTEGER
Return value
9007199254740991
Examples
console.log(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER + 2);
Output
9007199254740991 9007199254740992
const id = "9007199254740993";
console.log(Number(id), BigInt(id));
Output
9007199254740992 9007199254740993n
Version history
| Version | Change |
|---|---|
| JavaScript ES2015 | Added |
Related
Number.isSafeInteger()· Return true if a value is an integer that can be represented exactly, between -(2^53 - 1) and 2^53 - 1.Number.EPSILON· The smallest difference between 1 and the next representable number, used as a tolerance when comparing floats.- JavaScript Numbers · tutorial
- JavaScript Type Conversion · tutorial