Skip to content

Big Number Calculator

Performs exact arithmetic on numbers far beyond 64 bits, including power, modulo and factorial.

Arithmetic on integers far beyond what a calculator can hold: powers, factorials, modular arithmetic, all exact. An ordinary calculator stops telling the truth at 2^53, where 9007199254740992 and 9007199254740993 become the same number, and everything after that comes back confidently wrong.

🔒 Runs entirely in your browserbignummathprecisioncalculator

Expression

+ − × ÷ % ^ and ! with brackets. Digits may be grouped with commas or underscores; hex (0xFF), binary (0b1010) and octal (0o17) literals are read too.

Result

115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936

digits

78

exact

yes

Functions

  • abs(a) — Magnitude, without the sign
  • gcd(a, b) — Greatest common divisor
  • lcm(a, b) — Least common multiple
  • pow(a, b) — a to the power of b — same as a^b
  • modpow(a, b, m) — a^b mod m, computed without ever forming a^b
  • fact(n) — n factorial — also written n!
  • sqrt(n) — Integer square root, rounded down
  • min(a, b) — The smaller of two
  • max(a, b) — The larger of two
An ordinary calculator stops telling the truth at 2⁵³: above it, 9007199254740992 and 9007199254740993 are the same number to a double, so factorials, large powers and modular exponentiation all come back confidently wrong. Everything here is arbitrary-precision integer arithmetic, and the only limits are on how long something would take — a power with more than 100,000 digits is refused rather than left to freeze the tab.

How to use it

  1. Type the expression

    Plus, minus, times, divide, modulo, power and factorial with brackets. Digits can be grouped with commas or underscores, and hex, binary and octal literals are read too.

  2. Read the digit count

    Beside the answer, because at this size the number of digits is often the more useful fact. 100! has 158 of them.

  3. Group the digits to read them

    A 158-digit number is unreadable in one run. Grouping puts separators in without changing the value.

Common questions

What happens when I divide?

Integer division: the answer is truncated and the remainder is shown beside it. Everything here is integer arithmetic. For an exact fractional value use the fraction calculator.

Why was my power refused?

Because the answer would have more than 100,000 digits, and computing and rendering it would freeze the tab. The limit is on how long something would take rather than on how large a number can be.

Is modular exponentiation supported?

Yes, and it is done by repeated squaring rather than by computing the power first. That is the difference between an instant answer and a number with a million digits that then gets thrown away.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.