Last Updated : 15 Jul, 2025
The JavaScript Number.MAX_SAFE_INTEGER is a constant number that represents the maximum safe integer. This constant has a value of (253 - 1). Here safe refers to the ability to represent integers and to compare them.
Syntax:
Number.MAX_SAFE_INTEGER
Return Value: A constant number.
Example 1: Below example illustrates the usage of Number.MAX_SAFE_INTEGER
JavaScript
const a = Number.MAX_SAFE_INTEGER + 1;
const b = Number.MAX_SAFE_INTEGER + 2;
console.log(Number.MAX_SAFE_INTEGER);
console.log(a);
console.log(a === b);
Output:
9007199254740991 9007199254740992 true
Example 2: Below example illustrates the usage of the constants Number.MAX_SAFE_INTEGER using Math.pow() function.
JavaScript
const a = Number.MAX_SAFE_INTEGER;
const b = -(Math.pow(2, 53) - 1);
console.log(a);
console.log(b);
console.log(a === b);
Output:
9007199254740991 -9007199254740991 false
Supported Browsers:
We have a complete list of JavaScript Number constructor, properties, and methods list, to know more about the numbers please go through that article.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4