Number.MAX_SAFE_INTEGER is the largest integer a JavaScript Number can represent exactly — 253 - 1 (9007199254740991). Above that, float rounding skips integers. It is a static property (ES2015), not a method.
Read the notes below before you rely on this property. Prefer feature detection when support is limited.
Syntax
Use Number.MAX_SAFE_INTEGER. Start with this line.
JavaScript
Number.MAX_SAFE_INTEGER
Call
What it does
Number.MAX_SAFE_INTEGER
Primary signature.
Built into JavaScript. Read Number.MAX_SAFE_INTEGER on the Number constructor — no import required.
Library declarations
JavaScript
Number.MAX_SAFE_INTEGER
Parameters
Parameter
Description
BigInt
Optional. Exact integers outside the safe range
Return Value
Return Value
Description
*
The current value of Number.MAX_SAFE_INTEGER.
JavaScript Examples
Example 1 — Read Number.MAX_SAFE_INTEGER
Print the constant and confirm it equals 2 ** 53 - 1.
One past.max + 1 is outside the safe range → false.
Literal form. The decimal literal 9007199254740991 is the same safe value.
Use as a gate. Reject or convert to BigInt when the check fails.
Compatibility
Browser & Runtime Support
Number.MAX_SAFE_INTEGER is part of ES2015 and is Baseline Widely available in modern browsers and Node.js.
✓ Baseline · ES2015
Number.MAX_SAFE_INTEGER
Supported in Chrome, Firefox, Safari, Edge, and Node.js for years. Safe for modern apps without a polyfill.
98%Modern browser support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
Number.MAX_SAFE_INTEGERExcellent
Bottom line: Use Number.MAX_SAFE_INTEGER freely in modern JavaScript. Older engines without it can use the literal Math.pow(2, 53) - 1 as a fallback.
Frequently Asked Questions
Number.MAX_SAFE_INTEGER is the largest integer JavaScript can represent exactly as a Number — 2^53 - 1, which is 9007199254740991. Above that, consecutive integers are no longer all representable.
Yes. Read it on Number itself: Number.MAX_SAFE_INTEGER. There is no (5).MAX_SAFE_INTEGER on number instances, and it is not a method.
Safe means integers can be represented exactly and compared correctly. Past MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2 is true — which is mathematically wrong.
MAX_SAFE_INTEGER (~9e15) is the largest exact integer. MAX_VALUE (~1.8e308) is the largest finite float magnitude. Huge floats above the safe integer range are not precise integers.
Use BigInt for integers beyond the safe range. Check candidates with Number.isSafeInteger(n) before relying on Number arithmetic.
It is Baseline Widely available (ES2015) and supported in every modern browser and Node.js.