Last Updated : 23 Jul, 2025
JavaScript BigInt is an inbuilt object in JavaScript that provides a way to represent whole numbers larger than 253-1 which is the largest number that can represent with the Number primitive. It is represented by the MAX_SAFE_INTEGER constant.
Example: This example creates a BigInt by appending n at the end of the number.
JavaScript
// Decimal format
let bigNum = 123422222222222222222222222222222222222n
console.log(bigNum)
// Hexadecimal format
let bigHex = 0x1ffffffeeeeeeeeefn
console.log(bigHex)
// Binary format
let bigBin = 0b1010101001010101001111111111111111n
console.log(bigBin)
Output:
123422222222222222222222222222222222222n VM41:6 36893488074118328047n VM41:10 11430854655n
The complete methods of the JavaScript BigInt object are listed below:
JavaScript BigInt Constructor: A constructor gets called when an object is created using the new keyword.
Constructor Descriptions BigInt() Convert any primitive data type or object to a BigInt data type.JavaScript BigInt Properties: A JavaScript property is a member of an object that associates a key with a value.
JavaScript BigInt Methods: Methods are actions that can be performed on objects.
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