MDN doc

BigInt is a built-in object that provides a way to represent whole numbers larger than 2^53 - 1, which is the largest number JavaScript can reliably represent with the Number primitive and represented by the Number.MAX_SAFE_INTEGER constant. BigInt can be used for arbitrarily large integers.

Difference:

  • BigInt cannot be used with methods in the built-in Math object and cannot be mixed with instances of Number in operations
  • Because coercing between Number and BigInt can lead to loss of precision, it is recommended to only use BigInt when values greater than 2^53 are reasonably expected and not to coerce between the two types.
Answer from Dhruvil21_04 on Stack Overflow
🌐
TutorialsPoint
tutorialspoint.com › home › javascript › javascript bigint: handling large integers
Typescript BigInt Vs Number
September 1, 2008 - The BigInt data type in JavaScript is a numeric primitive that can represent integers with arbitrary magnitude. This is in contrast to the Number data type, which is limited to representing integers between -(253 - 1) and 253 - 1.
Discussions

JS Data Types - number vs BigInt questions
Where does number end and bigint begin? It's not like values below some threshold are numbers, and above that threshold they're bigints. They're two entirely different ways of representing numeric values. JavaScript's "number" type is a floating point type , which means that numbers are rounded to about 53 significant binary digits (which is roughly equivalent to 16 significant decimal digits). So you can store very large numbers, but your results will be inexact. Try calculating 10000000000000001 - 10000000000000000 and see what you get. What does n stand for or translate to? It's just syntax that tells the JS parser to interpret your numeric constant as a BigInt instead of a Number, so that it will be represented exactly. Is it infinity, or does it make it some continuous number? No idea what you mean by this. Is there an explicit way to declare a number vs bigint? Yes, like I said, that's what the n suffix is for. I want to see what happens if I declare a bigint as a number and vice versa. This doesn't make any sense in JavaScript. Variables don't have types; only values have types. A variable could store a Number value, or a BigInt value, but it has to be one or the other. It can't be both at the same time. But number is reserved, so I can't "let number = 123456789999n". The name of your variable is just a name. It doesn't have any connection to the data type that you store in the variable. Lastly, does anyone use bigint in programming, I mean, does it serve a practical purpose? Well, any time you want to do exact integer arithmetic without rounding. Just as one example, cryptographic algorithms often do arithmetic on integers with hundreds of digits. The exact value of those integers is crucial, and any rounding or inaccuracy would completely ruin the output. More on reddit.com
🌐 r/learnprogramming
4
1
October 13, 2025
How do I add a (number | bigint) to another (number | bigint), enforcing they they are of the same type?
E.g. as part of a function: const add = (a: T, b: T) => a + b; Edit: The above does not work and but since TypeScript is explicitly told that both parameters a and b are always of type T, that T is either number or bigint and both can use the + operator, I think this should work… Edit II, I was wrong: Because there’s no way to link the types of a and b without using a generic, whose constraints need to be a union to allow for number and bigint, what I was trying to express using my example above is actually not as strict as I’d like it to be… I played around a bit further but got nowhere, stick to overloading, like u/jydu suggests. More on reddit.com
🌐 r/typescript
19
7
August 15, 2023
What is the difference between 'bigint' (lowercase) and 'BigInt'?
So I am trying to update some typescript code that uses external library for big numbers to BigInt (ES2020) and linter is complaining a lot. I don't really understand what is going on here. It looks More on stackoverflow.com
🌐 stackoverflow.com
BigInt vs number
I want to use JS number, but need int8 as db row type. To work with int8 I need to assign BigInt as Prisma type within schema.prisma, which then in turn kills compatibility with number. Can I speci... More on github.com
🌐 github.com
3
5
🌐
Tektutorialshub
tektutorialshub.com › home › typescript › typescript bigint vs number
Typescript BigInt Vs Number - Tektutorialshub
March 15, 2023 - bigInt is stored as arbitrary-precision integers and the number as double-precision 64-bit number.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › difference-between-bigint-and-number-in-javascript
Difference Between BigInt and Number in JavaScript - GeeksforGeeks
July 23, 2025 - Created by appending n to the end of an integer literal or using BigInt constructor. Supports arithmetic operations such as the addition, subtraction, multiplication, division and exponentiation. Cannot be used with the Number type directly in the arithmetic operations without explicit conversion.
🌐
Reddit
reddit.com › r/learnprogramming › js data types - number vs bigint questions
r/learnprogramming on Reddit: JS Data Types - number vs BigInt questions
October 13, 2025 -

Hi there, I'm learning data types in javascript. Messing around. I used these variables.

let x = 15;
let y = 123456789999;

typeof shows them both as numbers. So it got me thinking...

  1. Where does number end and bigint begin? I went as high as let y = 1234567899999999999999999999999999999; and it was still a number. When I put an n on the end, it's bigint, so

  2. What does n stand for or translate to? Is it infinity, or does it make it some continuous number? I thought number and bigint were separate DTs for memory purposes, so

  3. Is there an explicit way to declare a number vs bigint? I want to see what happens if I declare a bigint as a number and vice versa. But number is reserved, so I can't "let number = 123456789999n".

  4. Lastly, does anyone use bigint in programming, I mean, does it serve a practical purpose?

Thanks

Top answer
1 of 2
4
Where does number end and bigint begin? It's not like values below some threshold are numbers, and above that threshold they're bigints. They're two entirely different ways of representing numeric values. JavaScript's "number" type is a floating point type , which means that numbers are rounded to about 53 significant binary digits (which is roughly equivalent to 16 significant decimal digits). So you can store very large numbers, but your results will be inexact. Try calculating 10000000000000001 - 10000000000000000 and see what you get. What does n stand for or translate to? It's just syntax that tells the JS parser to interpret your numeric constant as a BigInt instead of a Number, so that it will be represented exactly. Is it infinity, or does it make it some continuous number? No idea what you mean by this. Is there an explicit way to declare a number vs bigint? Yes, like I said, that's what the n suffix is for. I want to see what happens if I declare a bigint as a number and vice versa. This doesn't make any sense in JavaScript. Variables don't have types; only values have types. A variable could store a Number value, or a BigInt value, but it has to be one or the other. It can't be both at the same time. But number is reserved, so I can't "let number = 123456789999n". The name of your variable is just a name. It doesn't have any connection to the data type that you store in the variable. Lastly, does anyone use bigint in programming, I mean, does it serve a practical purpose? Well, any time you want to do exact integer arithmetic without rounding. Just as one example, cryptographic algorithms often do arithmetic on integers with hundreds of digits. The exact value of those integers is crucial, and any rounding or inaccuracy would completely ruin the output.
2 of 2
2
JS' BigInt type is a string based number. So it has no standardized lower and upper limits. But it does have those limits depending on its implementation. e.g. both Firefox (SpiderMonkey JS engine) and Chromium (V8 JS engine), have different lower/upper limit in terms of number of digits. The n is just a type specifier for BigInt much like the "/' for String. i.e. 123 is a number (the default), "123" is a string, and 123n is a BigInt. BigInt is as it's design for. To handle very big number. This is expecially useful for exact scientific measurements. Both in small and large scale, where the number of digits is greater than 15 - which normal JS number type can't store or can't accurately store.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › BigInt
BigInt - JavaScript | MDN
BigInt values are similar to Number values in some ways, but also differ in a few key matters: A BigInt value cannot be used with methods in the built-in Math object and cannot be mixed with a Number value in operations; they must be coerced to the same type.
🌐
W3Schools
w3schools.com › js › js_bigint.asp
W3Schools.com
BigInt can represent an integer of any size, limited only by available memory. JavaScript Numbers are only accurate up to 15 digits:
Find elsewhere
🌐
Medium
medium.com › @turingvang › ts1353-a-bigint-literal-must-be-an-integer-594af8288476
TS1353: A bigint literal must be an integer | by Turingvang | Medium
March 16, 2025 - BigInt is a built-in object in JavaScript (and consequently TypeScript) that allows representation of integers larger than Number.MAX_SAFE_INTEGER. However, the syntax for BigInt must be an integer followed by the n suffix.
🌐
LogRocket
blog.logrocket.com › home › how to use javascript’s bigint
How to use JavaScript's BigInt - LogRocket Blog
June 4, 2024 - Delivered once a week, it's your ... software. BigInt is a numerical data type that can be used to represent both small and large numbers that cannot be represented by the older numerical data type, number....
🌐
TypeScript Tutorial
typescripttutorial.net › home › typescript tutorial › typescript number
TypeScript Number
October 18, 2024 - All numbers in TypeScript are either floating-point values or big integers. The floating-point numbers have the type number while the big integers get the type bigint.
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Data_structures
JavaScript data types and data structures - JavaScript | MDN
You can use most operators to work with BigInts, including +, *, -, **, and % — the only forbidden one is >>>. A BigInt is not strictly equal to a Number with the same mathematical value, but it is loosely so.
🌐
Tektutorialshub
tektutorialshub.com › home › javascript › bigint vs number in javascript
BigInt Vs Number in JavaScript - Tektutorialshub
January 30, 2022 - The number can handle numbers up to 9007199254740991 ( Number.MAX_SAFE_INTEGER). It is a limitation imposed due to the double precision 64 bit number · The BigInt can handle numbers larger than that.
🌐
TypeScript
typescriptlang.org › docs › handbook › release-notes › typescript-3-2.html
TypeScript: Documentation - TypeScript 3.2
BigInt support in TypeScript introduces ... of any integer numeric literal: ... While you might imagine close interaction between number and bigint, the two are separate domains....
🌐
Tektutorialshub
tektutorialshub.com › home › typescript › typescript bigint
Typescript Bigint - Tektutorialshub
March 15, 2023 - It is available only if you target esnext in tsconfig.json. It is added so as to support the large number. bigint cannot be used in the operations involving numbers. They must be coerced to do that.