Number.MAX_SAFE_INTEGER
Last updated: 2026-09-09
Number.MAX_SAFE_INTEGER MAX_SAFE_INTEGER
MAX_SAFE_INTEGER is the largest integer JS can represent exactly (2^53 - 1).
| Category | Numbers |
|---|---|
| ES version | ES2015 |
📝 Syntax
Number.MAX_SAFE_INTEGER;
Returns:The constant: 9007199254740991.
Mutates the original:No (returns a new value)
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
9007199254740991
9007199254740992
9007199254740992
true
💡 Tip For large integers (like DB IDs) beyond MAX_SAFE_INTEGER, use BigInt.
ℹ️ info There are also MIN_SAFE_INTEGER and isSafeInteger().
🌐 Browser support
| Browser | |||||
|---|---|---|---|---|---|
| Number.MAX_SAFE_INTEGER | ✓ v34 | ✓ v12 | ✓ v32 | ✓ v9 | ✓ v21 |
| Supported by all modern browsers | |||||
🏷️ Related Items
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
QWhat if beyond MAX_SAFE_INTEGER?
AUse BigInt: 9007199254740993n.
QWhy 2^53 - 1?
AJS numbers use IEEE 754 double — 53-bit mantissa.
QHow to check safe integer?
ANumber.isSafeInteger(value).