Big Number Calculator
Arithmetic on arbitrarily large integers using JavaScript BigInt.
How to Use
- Enter two integers of any length in fields A and B.
- All four operations (addition, subtraction, multiplication, division with remainder) compute exactly in BigInt — no precision loss.
- Results may be hundreds or thousands of digits long; the display wraps and uses monospace for readability.
- Negative numbers are supported (prefix with -).
- For decimal-point arithmetic, use the regular Scientific Calculator instead — BigInt is integers only.
- Click any result to copy it.
Notes
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.
Why does division show a remainder?
BigInt division is integer division — it truncates toward zero. To preserve information, the calculator shows quotient × divisor + remainder = dividend, so you can reconstruct the original numbers. For 100 / 7, you get quotient = 14, remainder = 2, which means 14 × 7 + 2 = 100.
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.
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: