Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Big Number Calculator

Every digit exact: huge sums, products, powers, roots and factorials.

Math No upload Works offline Free, no sign-up

A whole number or a decimal, up to 100,000 digits. Commas, spaces and powers of ten such as 1e100 are fine — or type a whole calculation such as 2^100.

A whole number or a decimal.

For answers that do not end: up to 10,000 places, the last one rounded half away from zero.

Result

A × B —

All digits

All digits of the result

    Next steps

    About the Big Number Calculator

    Ordinary calculators and spreadsheets keep only about 15 significant digits — Excel’s limit is 15 — so 2^100 or 12345678901234567890 × 98765432109876543210 comes back rounded. This calculator keeps every digit. Type whole numbers or decimals of up to 100,000 digits each and add, subtract or multiply them exactly; divide to get the quotient with its remainder and the decimal value to as many as 10,000 places; raise to whole-number powers (2^1000 has all 302 digits); take square, cube and higher roots; and find A mod B, the greatest common divisor with Bézout’s coefficients, and the least common multiple. Answers can have up to a million digits.

    Factorial n! gives the exact value of n! for n up to 100,000 — 100,000! has 456,574 digits — with its length, the number of trailing zeros by Legendre’s formula, the double factorial n!! and Stirling’s approximation with its error. Copy a result, download it as a text file, or use it as the next first number. The calculations run in your browser, in the background, so even very long ones never freeze the page.

    How to use it

    1. Choose Arithmetic or Factorial n!.
    2. Arithmetic: type or paste the first number (A), choose the operation and type B. Commas, spaces and powers of ten such as 1e100 are fine. You can also type or paste a whole calculation such as 2^100 or 123 × 456 into the first box: the operation and B follow it.
    3. For division, negative powers and roots, set the decimal places of the decimal answer.
    4. Factorial n!: type n, from 0 to 100,000, or pick an example.
    5. Pick the digit grouping you read most easily, then Copy the full number, Download .txt, or press Use as A to keep calculating with the result.

    Examples

    A power of two
    Input
    2^100
    Result
    1,267,650,600,228,229,401,496,703,205,376

    31 digits, every one exact. A spreadsheet that keeps 15 significant digits stores 1.26765060022823 × 10³⁰.

    Division with a remainder
    Input
    100000000000000000000 ÷ 7
    Result
    Quotient 14,285,714,285,714,285,714, remainder 2; as a decimal 14,285,714,285,714,285,714.285714…

    Check: 7 × 14,285,714,285,714,285,714 + 2 = 10²⁰.

    100 factorial
    Input
    100!
    Result
    9.33262154439 × 10¹⁵⁷ — 158 digits, 24 of them trailing zeros

    Legendre’s formula: ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 zeros.

    A remainder of a negative number
    Input
    −7 mod 3
    Result
    2

    JavaScript’s −7 % 3 gives −1 (the sign of A); Python’s −7 % 3 gives 2. Both are shown when they differ.

    Decimals stay exact
    Input
    0.1 + 0.2
    Result
    0.3

    Ordinary floating-point arithmetic gives 0.30000000000000004.

    Common uses

    • Checking the exact value of a huge power, product or factorial for homework, a puzzle or a programming exercise.
    • Testing big-integer code (RSA-style numbers, hash values, modular arithmetic) against exact answers.
    • Counting arrangements: 52! ≈ 8.07 × 10⁶⁷ ways to shuffle a deck of cards.
    • Getting thousands of decimal places of a quotient or a square root.

    How the arithmetic stays exact

    Each number is held as a whole number of any length (JavaScript’s BigInt) together with the position of its decimal point, so 12.5 is 125 with one decimal place. Adding and subtracting line the decimal points up; multiplying multiplies the digits and adds the decimal places; dividing works on whole numbers too. These are the multiple-precision methods described by Donald Knuth in The Art of Computer Programming, Volume 2, §4.3. Nothing is converted to floating point, so no digit is lost or invented. The only rounding is where you ask for a decimal that does not end, and that last digit is rounded half away from zero.

    Trailing zeros of n! — Legendre’s formula

    Legendre’s formula gives the exponent of a prime p in n! as ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + …, stopping when the power of p is bigger than n. A trailing zero needs a factor 10 = 2 × 5, and n! always has more factors 2 than 5, so the number of trailing zeros is the exponent of 5. For 1,000! that is 200 + 40 + 8 + 1 = 249. The calculator works it out this way, checks it against the exact digits, and lists the exponent of every prime in n! for n up to 2,000.

    Stirling’s approximation

    n! ≈ √(2πn) · (n/e)ⁿ. The estimate is always slightly low, by a relative error close to 1/(12n): about 0.83% for n = 10 and 0.083% for n = 100. Multiplying by (1 + 1/(12n)), the next term of Stirling’s series, removes most of the remaining error. Because the calculator also has the exact value, it shows how far off the estimate is.

    Remainders of negative numbers

    For negative numbers “A mod B” has three common definitions. The mathematical (Euclidean) remainder is never negative: −7 mod 3 = 2. The % operator of JavaScript, C, C++, Java and C# keeps the sign of A: −7 % 3 = −1. Python’s % operator and Excel’s MOD function keep the sign of B: 7 mod −3 = −2. The calculator gives the Euclidean remainder and lists the others whenever they differ.

    Double factorials

    n!! multiplies every other number down to 1 or 2: 9!! = 9 × 7 × 5 × 3 × 1 = 945 and 10!! = 10 × 8 × 6 × 4 × 2 = 3,840, with 0!! = 1. It is not (n!)!. Double factorials turn up in the volumes of spheres in many dimensions and in integrals of powers of sine and cosine.

    Limitations

    • Numbers you type can have up to 100,000 digits and results up to 1,000,000 digits. GCD and LCM accept up to 20,000 digits (Bézout’s coefficients up to 5,000), factorials go up to n = 100,000 and decimal answers up to 10,000 places.
    • Exponents and root indices must be whole numbers. For fractional or decimal exponents use the exponent calculator; for fractions such as 1/3 use the fraction calculator.
    • Very long results can take a few seconds in some browsers. The page stays usable and Stop cancels the calculation.
    • The digits box shows the start and the end of results longer than 30,000 characters until you ask for every digit; Copy and Download always give the whole number.

    Privacy

    Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

    Frequently asked questions

    Why does my normal calculator give a different answer for big numbers?

    Most calculators, spreadsheets and programming languages store numbers in 64-bit floating point, which keeps about 15–17 significant digits (Excel works to 15). Beyond that the last digits are rounded: with 15 significant digits, 2^64 = 18,446,744,073,709,551,616 becomes 18,446,744,073,709,600,000, and not every whole number above 2^53 = 9,007,199,254,740,992 can even be stored. This calculator keeps every digit.

    How many digits does 1000! have?

    2,568, ending in 249 zeros (⌊1000/5⌋ + ⌊1000/25⌋ + ⌊1000/125⌋ + ⌊1000/625⌋ = 200 + 40 + 8 + 1). For comparison, 100! has 158 digits and 24 zeros, and 10,000! has 35,660 digits and 2,499 zeros.

    How do I find the remainder of a huge division?

    Choose A ÷ B: the answer shows the whole-number quotient (rounded toward zero) and the remainder, and checks that B × quotient + remainder = A. A mod B gives the remainder on its own, never negative, and the other conventions when A or B is negative.

    What are Bézout coefficients?

    Whole numbers x and y with A × x + B × y = GCD(A, B). For 240 and 46 the GCD is 2, and 240 × (−9) + 46 × 47 = 2. The extended Euclidean algorithm finds them; they are how modular inverses are computed, for example in RSA cryptography.

    Is 0.1 + 0.2 really 0.3 here?

    Yes. Decimals are stored as exact whole numbers with a decimal point, not as binary fractions, so 0.1 + 0.2 = 0.3 and 1.1 × 1.1 = 1.21 exactly. Only decimals that never end, such as 1 ÷ 3, are rounded, to the number of places you choose.

    Can it take the factorial of a decimal, such as 2.5!?

    No. n! here is the product 1 × 2 × … × n for whole numbers n. Extending it to fractions needs the gamma function, Γ(n + 1), whose values are irrational and cannot be given exactly.

    Quick answers and tool search

    Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.