It seems like there is no maximum limit to a BigInt as per spec, which makes sense considering BigInts are supposed to be arbitrary-precision integers, whose "digits of precision are limited only by the available memory of the host system".

As for v8 specifically, according to this article on the v8 blog, the precision of BigInts are "arbitrary up to an implementation-defined limit". Unfortunately, I couldn't find any further information on how the limit is determined. Maybe someone else would be able to shed light on this based on these v8 BigInt implementation notes?

That said, based on the aforementioned articles, there doesn't seem to be a specific maximum value/size for a BigInt. Rather, it is likely determined based on the available memory on the system in some way.

Answer from zwliew on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › BigInt
BigInt - JavaScript | MDN
BigInt values represent integer values which are too high or too low to be represented by the number primitive.
🌐
W3Schools
w3schools.com › js › js_bigint.asp
JavaScript BigInt
Like numbers, bigint literals support ...0000000000000000000000000000000000000000011n; Try it Yourself » · Maximum safe integer in JavaScript is 9007199254740991....
🌐
GitHub
github.com › tc39 › proposal-bigint › issues › 174
Is the maximally allowed BigInt specified? · Issue #174 · tc39/proposal-bigint
November 9, 2018 - I happened to notice that chrome happens to throw when the result of a BigInt arithmetic operation is too large. Is the exact maximal value specified/documented/available anywhere? (And does anyone else think that needing to wrap all my ...
Published   Nov 09, 2018
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › MAX_SAFE_INTEGER
Number.MAX_SAFE_INTEGER - JavaScript | MDN
Number.MAX_SAFE_INTEGER represents ... The largest representable number in JavaScript is actually Number.MAX_VALUE, which is approximately 1.7976931348623157 × 10308....
🌐
V8
v8.dev › features › bigint
BigInt: arbitrary-precision integers in JavaScript · V8
The native BigInt implementation ... Number.MAX_SAFE_INTEGER constant gives the greatest possible integer that can safely be incremented. Its value is 2**53-1....
🌐
Snowfrog's blog
blog.snowfrog.dev › bigint-math
Using Math on BigInt
July 2, 2019 - As you may know, the largest number that can be reliably represented in JavaScript using the Number primitive is 253 or, for comparison, a bit less than 1016. So Number wasn't anywhere close to cutting it. Thankfully, now, there is BigInt.
Top answer
1 of 3
75
Fun question! So in JavaScript, every value with the "number" type is represented under the hood with a 64-bit (or "double-precision") floating point number. Floating point numbers represent a value with a combination of fractions and exponents, which allows them to represent a lot of numbers (with varying degrees of precision), but at the end of the day, the value still has to fit within 64-bits somehow. So there are limits. In this case, the highest number a 64-bit float can possibly represent happens to be 1.7976931348623157e+308 (this number is stored in the constant Number.MAX_VALUE should you ever need to reference it). Your value of 1e+309 is larger than that, so the best a 64-bit float can do is call it Infinity. Under the IEEE 754 floating-point standard (which JavaScript uses), there are some special values, like NaN and Infinity. You can basically think of NaN as "something went wrong with this number" and Infinity as "this number is bigger than I can do anything useful with". Both special values sort of infect anything they touch. The result of any math with NaN is NaN. The result of (almost) any math with Infinity is Infinity. console.log(NaN * 2); // NaN console.log(Infinity - 100); // Infinity console.log(Infinity * 0); // NaN Jumping back to those varying degrees of precision, the highest integer you can represent without losing any precision happens to be a good deal smaller than 1e+308. Since everything is actually a float under the hood, you can only get up to 253 - 1 (or 9,007,199,254,740,991) before you can't trust integer math to work right anymore (that number is stored in the constant Number.MAX_SAFE_INTEGER by the way). console.log(9007199254740991 + 10); // 9007199254741000 Now, the good news for anyone who loves big numbers, is that JavaScript recently added a new primitive type, "bigint". You can make a value a BigInt by adding an n to the end, or by calling BigInt on it. const num = 7; // <-- number const big = 7n; // <-- bigint const int = BigInt(7); // <-- bigint There are two big differences between BigInts and vanilla numbers. They are integers, not floating point. This means you can't represent fractions, but you also never lose precision. They are variable-bit. They start as 64-bit, but if the value gets to large, more bits are added. So with BigInt, we can represent big numbers. let x = 10n ** 309n; // e-notation not supported with BigInt console.log(x); // 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000n And we can safely do big integer math. console.log(9007199254740991n + 10n); // 9007199254741001n But any decimal places just end up getting dropped. console.log(5n / 2n); // 2n
2 of 3
9
JavaScript uses double-precision floating point values to store numbers. The highest number you can store in this format is 1.7976931348623157e+308 or 2^1024. Anything higher than that is rounded to Infinity, as part of the floating point spec.
Find elsewhere
🌐
Designcise
designcise.com › web › tutorial › what-is-the-math-max-alternative-for-bigint-values-in-javascript
What's the Math.max() Alternative for BigInt Values in JavaScript? - Designcise
September 27, 2022 - Therefore, to find the maximum value in a list of bigint numbers, you can do the following: function max(...values) { if (values.length maxValue) { maxValue = value; } } return maxValue; } You can use this function to find the maximum bigint ...
🌐
Smashing Magazine
smashingmagazine.com › 2019 › 07 › essential-guide-javascript-newest-data-type-bigint
The Essential Guide To JavaScript’s Newest Data Type: BigInt — Smashing Magazine
The BigInt data type aims to enable JavaScript programmers to represent integer values larger than the range supported by the Number data type. The ability to represent integers with arbitrary precision is particularly important when performing mathematical operations on large integers.
🌐
Scaler
scaler.com › home › topics › javascript bigint library
JavaScript BigInt Library - Scaler Topics
September 29, 2023 - The JavaScript BigInt is a built-in object in javascript that is used to store the numbers that are greater than Number.MAX_SAFE_INTEGER. There are some rules to create a JavaScript BigInt value. We can make a JavaScript BigInt by adding n to the end of any integer literal that we want to change ...
🌐
LogRocket
blog.logrocket.com › home › how to use javascript’s bigint
How to use JavaScript's BigInt - LogRocket Blog
June 4, 2024 - Interestingly, with BigInt, we can safely and precisely perform calculations on integers that are bigger than Number.MAX_VALUE because it has an arbitrary precision, meaning that the size of the integer it can perform operations on is only limited by the available memory on the host computer or system.
🌐
GeeksforGeeks
geeksforgeeks.org › bigint-in-javascript
BigInt in JavaScript - GeeksforGeeks
June 25, 2020 - BigInt is a built-in object in JavaScript that provides a way to represent whole numbers larger than 253-1. The largest number that JavaScript can reliably represent with the Number primitive is 253-1, which is represented by the MAX_SAFE_INTEGER ...
🌐
DEV Community
dev.to › micmath › counting-the-stars-with-javascript-the-use-case-for-the-bigint-primitive-1be0
Counting Stars with JavaScript: Using the BigInt Type - DEV Community
May 29, 2025 - That means you can work with much larger integer values. There is no upper maximum specified for BigInt; the implementation of the JavaScript engine you use and the available memory on your machine are the only practical limits.
🌐
Dustin John Pfister
dustinpfister.github.io › 2019 › 09 › 06 › js-bigint
BigInt basics in javaScript for numbers beyond max safe int | Dustin John Pfister at github pages
November 24, 2021 - If I have a value that goes beyond Max Safe Integer and add another number to it I will start to loose precession. This is one reason why I would want to use some kind of library that will give me higher precession numbers to work with in the form of an object class, and special methods to work with such objects. However now with bigint there is a native solution that can be used. So If you are confident that the use of native javaScript ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript-bigint
JavaScript BigInt | GeeksforGeeks
November 12, 2024 - JavaScript BigInt is a built-in object that represents whole numbers larger than (2^{53} - 1). A BigInt value, also known as a bigint primitive, is created by appending n to an integer literal or by calling the BigInt() function with an integer ...
🌐
JavaScript in Plain English
javascript.plainenglish.io › going-big-with-javascript-numbers-71616cac8e44
Going BIG with JavaScript: Numbers | by Casey Gibson | JavaScript in Plain English
February 4, 2020 - As we can see, we our able to do comparisons above the Number.MAX_VALUE limit, with the downside of not being able to use decimal places. BigInt does have limits, however there isn’t any upper “hard limit” or even any “soft limit”. The documentation makes no mention of it. From other peoples experience on StackOverflow, it seems that the limits are governed by the JavaScript interpreter and also the devices memory limits.
🌐
Stack Abuse
stackabuse.com › bytes › maximum-and-minimum-values-for-integers-in-javascript
Maximum and Minimum Values for Integers in JavaScript
September 13, 2023 - If you need to work with larger ... numbers. For instance, Number.MAX_VALUE returns the largest positive representable number, which is approximately 1.8e+308....
🌐
Medium
medium.com › @adeyemimuaz1 › mastering-bigint-in-javascript-handling-large-integers-with-ease-d6475647c519
Mastering BigInt in JavaScript: Handling Large Integers with Ease. | by Adeyemi Muaz Ayomide | Medium
April 26, 2024 - This value, 9007199254740991 is the highest number Javascript can safely represent. The value is also accessible via Number.MAX_SAFE_INTEGER.
🌐
TutorialsPoint
tutorialspoint.com › what-is-javascript-s-highest-integer-value-that-a-number-can-go-to-without-losing-precision
What is JavaScript’s highest integer value that a Number can go to without losing precision?
You must use BigInt, which has no upper bound, to securely use integers larger than this. The maximum safe integer in that situation is 231-1, or 2,147,483,647. This is because bitwise and shift operators only work on 32-bit numbers. In this example let us understand how 32-bit integers can ...