Big Number Calculator: Factorials, Powers, GCD
Compute with integers beyond floating-point limits: arithmetic, powers, roots, factorials, GCD, LCM and prime factors. 100! shows all 158 digits exactly.
Results update as you type. Ctrl/Cmd+Enter copies the primary result.
Result
—
Bit view
Show the working
The Big Number Calculator performs exact integer arithmetic on values that ordinary floating-point calculators cannot hold. Addition, subtraction, multiplication, division, modulo, powers, integer roots, factorials, GCD, LCM and trial prime factorisation all return full digit strings rather than scientific approximations. Digit count and optional precision controls accompany every result so the size of the answer is visible at a glance.
All calculation runs in your browser. Nothing you enter is sent to a server.
Calculate with numbers beyond standard precision
Arbitrary-precision integers grow as large as memory allows. Enter operands as decimal digit strings, or with 0x / 0b prefixes when hex or binary input is convenient, and choose an operation. The primary output is the exact result; a secondary field reports how many digits it contains.
Standard calculators stop being exact long before cryptography or combinatorics care. Factorials, large powers and products of many terms overflow IEEE floats into infinity or round away low digits. This tool keeps every digit for integer results, which is the point of the page.
Understand where standard calculators lose accuracy
IEEE-754 double precision carries about 15 to 17 significant decimal digits. Integers above 2⁵³ (9,007,199,254,740,992) cannot all be represented exactly in a double; past that point, odd integers are rounded to nearby even ones. Pocket calculators and spreadsheet cells that use doubles therefore lie quietly on large whole numbers.
2^53 = 9007199254740992 last consecutive integer a double holds exactly
2^53 + 1 cannot be distinguished from 2^53 in a double
Floating-point multiplication and division also introduce rounding error on fractional results. The Big Number Calculator avoids that class of error for integer operations by using big-integer arithmetic. Non-integer roots and divisions still need a precision setting, because those results are not finite digit strings by nature.
Run arithmetic on very large integers
Addition, subtraction, multiplication, division and modulo accept operands of hundreds or thousands of digits. Division returns an integer quotient; modulo returns the remainder with the usual sign conventions for the engine. Multiplying two 100-digit numbers produces up to a 200-digit product without scientific notation hiding the middle.
Borrowing and carrying follow the same rules as hand arithmetic, extended across digit arrays. Performance stays interactive for sizes common in homework and programming contests; pathological inputs with tens of thousands of digits may pause the tab while the browser works. Cancel and retry with a smaller case if the page becomes unresponsive.
Calculate powers, roots and factorials
Powers compute base^exponent for non-negative integer exponents with an exact integer result. Integer square roots return the floor of the true root and can show the remainder. Factorial n! multiplies every integer from 1 through n and returns the full digit string, which for 100! is 158 digits long and far past what a double can store exactly.
100! has 158 digits. The leading digits are 9332621544… and the full string is too long for casual handwriting, which is why the calculator exists. Digit count alone answers many contest checks: if a problem asks whether 100! fits in a 256-bit register, 158 decimal digits is already more than enough to decide (256 bits hold at most 78 decimal digits).
| n | n! (trailing form) | Digits |
|---|---|---|
| 10 | 3,628,800 | 7 |
| 20 | 2,432,902,008,176,640,000 | 19 |
| 50 | (long) | 65 |
| 100 | (long) | 158 |
Negative factorials are undefined for integers. Very large n will eventually exhaust browser memory; the tool reports failure rather than returning a truncated value.
Find the greatest common divisor and lowest common multiple
GCD uses the Euclidean algorithm: replace the larger number by the remainder of division until the remainder is zero. The last non-zero remainder is the GCD. LCM follows from LCM(a, b) = |a × b| / GCD(a, b) with big-integer multiplication so the product does not overflow.
Coprime integers have GCD 1. Reducing a fraction or an aspect ratio is GCD division on both terms; the Aspect Ratio Calculator owns that UI, while this page exposes the raw GCD and LCM operations for arbitrary integers. Entering 1920 and 1080 yields GCD 120, which is the same factor that reduces a Full HD frame to 16:9.
Find prime factors of a large number
Trial division peels off small prime factors, then continues upward against the remaining cofactor until that cofactor is prime or the search limit is hit. Semiprimes built from two large primes are the hard case: trial division will not finish interactively in a browser, and the page states that limit rather than hanging silently.
| Input | Factors |
|---|---|
| 12 | 2² × 3 |
| 97 | 97 (prime) |
| 1,001 | 7 × 11 × 13 |
The calculator states limits honestly. Numbers with small factors factor quickly. Numbers built like RSA moduli will not finish in interactive time, and that is expected: cryptography relies on that difficulty. For teaching and contest problems with moderate composites, the factorisation view is enough.
Set the precision for non-exact results
Square roots of non-perfect squares and divisions that do not land on integers need a precision setting: a number of significant digits to compute before rounding. Scientific notation is available for very large or very small magnitudes when the full digit string is unwieldy.
Integer-only operations ignore the precision control because the exact answer is finite. Mixing modes is a common mistake: setting precision to 10 does not truncate 100!; factorial still returns all 158 digits. Precision applies to approximate operations only.
Use big numbers in practice
Cryptography talks about key sizes in bits: a 2048-bit RSA modulus is a roughly 617-digit decimal integer. Combinatorics produces factorials and binomial coefficients that outgrow 64-bit registers immediately. Competitive programming problems often ask for answers modulo a prime, which still needs big intermediate products before reduction.
When a language offers a built-in big-integer type (Python int, Java BigInteger, JavaScript BigInt), this calculator is a scratch pad for checking those programs. When a language is stuck on doubles, the calculator is the reference for what the exact value should have been.
Frequently asked questions
Why does a normal calculator fail on large integers?
Doubles keep about 15 to 17 significant digits and cannot represent every integer above 2⁵³. Large whole numbers are rounded, so low-order digits become wrong even though the display still looks precise.
How many digits does 100! have?
100! has 158 digits. The Big Number Calculator returns the full integer and reports that count as a secondary field, matching the engine fixture used in tests.
What is arbitrary precision?
Arbitrary precision means the digit count grows as needed instead of fitting a fixed register such as 64 bits. Results stay exact for integer operations until memory runs out.
How is GCD calculated?
The Euclidean algorithm repeatedly replaces the larger number with the remainder of division by the smaller until the remainder is zero. The last non-zero remainder is the GCD. LCM is then derived from the product divided by the GCD.
Can the calculator factor any number?
No. Trial division handles numbers with small prime factors. Semiprimes with two large prime factors, of the kind used in RSA, will not factor in interactive time in a browser, and the page does not pretend otherwise.
Do powers always return exact results?
Integer powers with non-negative exponents return exact integers. Fractional exponents and non-integer roots use the precision setting and may round. Negative exponents produce reciprocals that are generally not integers.
What input formats are accepted?
Decimal digit strings are the default. Prefixes 0x and 0b allow hexadecimal and binary integer input for the same operations. Commas as thousand separators are not required and may be rejected depending on the field parser.
Is calculation uploaded to a server?
No. Big-integer work runs in the browser. Large intermediates never leave the device, which matters when operands come from homework keys or local experiment data.
How does this relate to JavaScript BigInt?
The engine uses big-integer arithmetic in the same spirit as BigInt: exact integers, no floating-point rounding. The page is a UI over those operations with digit counts, factorials and factorisation helpers attached.
When should precision be raised?
Raise precision for roots and non-exact division when more significant digits are needed for a comparison or a printout. Integer factorial, GCD and modular arithmetic do not consume that setting.
Summary
The Big Number Calculator keeps exact integer results where doubles lose digits past roughly 15 significant figures and past 2⁵³. Arithmetic, powers, factorials, GCD, LCM and trial factorisation run locally, with 100! reported as a 158-digit integer. Precision controls apply to non-integer roots and divisions only. Cryptography-scale factorisation is acknowledged as out of scope for interactive trial division.