How this calculator works
Standard floating-point numbers, including the ones JavaScript and most calculators use internally, can only represent whole numbers exactly up to 2^53 − 1 (9,007,199,254,740,991). Beyond that point, integers start silently losing precision — two clearly different large numbers can even come out equal after rounding. This calculator sidesteps that limit entirely by using BigInt, a data type built specifically for exact, arbitrary-size integer arithmetic.
Enter two whole numbers of any length, choose an operation, and get an exact result with every digit correct. This tool works with integers only — no decimal points. Division returns both the quotient and the remainder, since a big-integer division rarely comes out even, and the power operation caps the exponent at a modest size so results stay a manageable length rather than growing to millions of digits.
How exact big-integer arithmetic works
A BigInt stores a number as a sequence of digits (in binary internally) with no fixed size limit, instead of the fixed 64-bit floating-point format regular numbers use.Add, subtract, multiply and power operations chain together basic digit-by-digit arithmetic, the same way you would by hand, just far faster.Division: a ÷ b = quotient remainder r, where a = b × quotient + r and 0 ≤ |r| < |b|.Modulo here uses the floored convention (the result always takes the sign of the divisor), the standard mathematical definition — not JavaScript's built-in % operator, which instead takes the sign of the dividend and can return a negative remainder.
Worked example: 2 to the power of 100
- A regular calculator (or JavaScript's ** on ordinary numbers) computes 2^100 as a floating-point approximation, since the true result has 31 digits, far past the 15-17 significant digits a double-precision float can hold exactly.
- BigInt instead multiplies 2 by itself 100 times using exact integer arithmetic the whole way through.
- The exact result is 1,267,650,600,228,229,401,496,703,205,376 — every one of the 31 digits is correct, with zero rounding error.
- As a sanity check, 2^10 = 1,024 and squaring that ten times over (2^100 = (2^10)^10) gives the identical value, confirming the calculation.
Frequently asked questions
Why can't I just use a regular calculator or spreadsheet for this?
Regular numbers (including spreadsheet cells and JavaScript's default number type) are stored in 64-bit floating point, which can only represent integers exactly up to 2^53 − 1. Past that, results silently round to the nearest representable value — the calculation looks fine but the answer is wrong.
Why does division show a remainder instead of a decimal?
BigInt has no concept of a fractional part, so a ÷ b for whole numbers only makes sense as a quotient (how many times b fits into a) plus whatever is left over. If you need a decimal answer, divide the quotient and remainder using regular numbers afterward, accepting normal floating-point precision.
Why is the power operation limited to a maximum exponent?
A base raised to a very large exponent can produce a result with millions of digits, which is both slow to compute and impractical to display. Capping the exponent keeps results at a size that is still exact but easy to read and copy.
Can I enter negative numbers or decimals?
Negative whole numbers are supported with a leading minus sign (for example -12345). Decimals are not supported — this calculator works with integers only, since BigInt itself has no fractional component.
How do I check that a big-integer result is actually correct?
Cross-check it with a smaller calculation you can verify by hand. For example, 2^10 = 1,024, and squaring that value ten times over is the same as 2^100, since (2^10)^10 = 2^100. Both routes give the identical 31-digit result, 1,267,650,600,228,229,401,496,703,205,376, with zero rounding error, because BigInt performs exact digit-by-digit arithmetic rather than floating-point approximation.