Big Number / Arbitrary Precision Calculator
Arbitrary-precision calculator for numbers normal calculators choke on: huge integers and decimals, factorials (1000!), powers (2^4096), modular arithmetic, prime checks, exact fractions, and √/∛/π/e to any number of digits.
How to Use
- Type a whole expression — e.g. <code>1000!</code>, <code>2^256</code>, <code>1/3</code>, <code>sqrt(2)</code>, <code>pi</code>, or <code>modpow(7, 10^18, 1000000007)</code> — then press Enter (or click Evaluate).
- Everything is computed <strong>exactly</strong> with rational (fraction) arithmetic: <code>0.1 + 0.2</code> gives exactly <code>0.3</code>, and <code>10/4</code> is the exact fraction <code>5/2</code> shown as <code>2.5</code> — no floating-point error.
- Set the <strong>Decimal precision</strong> for results that don't terminate: <code>1/7</code>, <code>sqrt(2)</code>, <code>pi</code> and <code>e</code> are shown to as many places as you ask (up to 20,000).
- Operators: <code>+ − × / % ^</code> and postfix <code>!</code>; decimals (<code>1.5</code>), hex (<code>0xFF</code>), scientific (<code>1.2e-9</code>), parentheses and implicit multiply (<code>2(3+4)</code>) all work.
- Functions — integer: <code>gcd lcm modpow modinv mod fact ncr npr fib lucas isprime nextprime isqrt iroot bitlength popcount</code>; decimal: <code>sqrt cbrt root exp</code> and constants <code>pi</code>, <code>e</code>.
- Each result shows readouts — digit count, scientific notation, bit length and hex for integers; the exact fraction and decimal expansion for non-integers. Click Copy for the full value.
Operators & functions
About the Big Number / Arbitrary Precision Calculator
Use the Big Number / Arbitrary Precision Calculator — a free, easy tool for everyday maths and number work. Nothing is uploaded, and you do not need an account. Arbitrary-precision calculator for numbers normal calculators choke on: huge integers and decimals, factorials (1000!), powers (2^4096), modular arithmetic, prime checks, exact fractions, and √/∛/π/e to any number of digits.
How it works
Put each value in its box and read the answer as you go. Because it recalculates live, you can play with the inputs to see how each one moves the result — handy for checking your own working or planning ahead. Everything happens on your device, so it is fast and private.
Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.
Frequently Asked Questions
Why do I need a 'big number' calculator?
JavaScript's native number type loses precision for integers larger than 2<sup>53</sup> (about 9 × 10<sup>15</sup>). Anything cryptographic (RSA keys, hashes interpreted as integers), combinatorial (large factorials, binomial coefficients), or scientific (Avogadro × moles for very large mole counts) needs arbitrary precision. BigInt gives you exact integer arithmetic with no upper limit other than memory.
What's BigInt?
A JavaScript primitive type added in ES2020 for exact integer arithmetic of any size. Created with literal suffix (1234n) or BigInt(value) constructor. Operations between BigInt and regular Number throw a TypeError, so the two types don't accidentally mix. This calculator uses BigInt under the hood.
Can I use decimals?
No — BigInt only handles integers. For exact decimal arithmetic (financial calculations, scientific measurements with fractional precision), you need a different library: decimal.js, big.js, or BigDecimal. For most purposes, multiply by a power of ten to convert decimals to integers (e.g., $123.45 → 12345 cents) and divide back at the end.
Is there a maximum size?
Effectively no — BigInt grows as needed up to the limits of your browser's available memory. Multiplication of 10,000-digit numbers takes a fraction of a second; arithmetic on 1,000,000-digit numbers can take seconds. Cryptographic-strength sizes (2,048–4,096 bits, ~600–1,200 digits) are easy.
What functions are available?
Number theory and combinatorics built for big integers: <code>gcd</code>/<code>lcm</code> (any number of args), <code>modpow(a,e,m)</code> for fast modular exponentiation (handles negative exponents via the modular inverse), <code>modinv(a,m)</code>, <code>sqrt</code>/<code>isqrt</code> (exact integer square root), <code>root(k,n)</code> (integer k-th root), <code>fact(n)</code> and postfix <code>n!</code>, <code>ncr(n,k)</code>/<code>npr(n,k)</code>, <code>fib(n)</code>/<code>lucas(n)</code> by fast doubling, <code>isprime(n)</code> (Miller–Rabin), <code>nextprime(n)</code>, plus <code>abs sign min max bitlength popcount mod</code>.
How does division and remainder work?
<code>/</code> is integer (truncating) division — <code>100 / 7</code> = 14. <code>%</code> gives the remainder with the dividend's sign (<code>100 % 7</code> = 2), while the <code>mod(a,m)</code> function returns the always-non-negative mathematical modulus. The two differ only for negative inputs.
Is isprime exact?
It's a Miller–Rabin test with the witness set {2,3,…,37}, which is <em>deterministic</em> (provably correct) for every n below 3.3 × 10<sup>24</sup>. Above that it's a very strong probabilistic test — no known composite passes this witness set — but not a formal proof. For cryptographic primality proving, use a dedicated tool.
How precise is regular floating point?
Double-precision IEEE 754 floats give about 15–17 significant decimal digits. For amounts that fit comfortably in that range (typical business calculations, most measurements), regular floats are fine and faster. For currency, dates, and any integer that might exceed 9 × 10<sup>15</sup>, BigInt is the safe choice.
How do I use the Big Number / Arbitrary Precision Calculator?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Cryptographic key arithmetic
Compute RSA modular exponentiation or perform large-prime arithmetic for cryptographic study (note: don't roll your own crypto for production).
Large factorials and combinatorics
Calculate 100! (158-digit number) or binomial coefficient C(1000, 500) without loss of precision.
Astronomical distances
Express interstellar distances in meters, or universe-age in Planck times, where the integer can have 30+ digits.
Currency conversion at scale
Convert national-debt-scale dollar amounts to fractional cents without floating-point drift.
Hash and ID arithmetic
Manipulate 256-bit hash values, ULIDs, or large UUIDs as integers.
Mathematical curiosity
Compute Fibonacci(1000) (208 digits) or 2^1000 exactly to see large numbers in their full form.
Last updated: