Math

Big Integer Calculator

Perform exact arithmetic on integers of any size with no precision loss: addition, multiplication, division with remainder, powers, factorials, GCD and base conversion.

Last reviewed by the Radiatus Cloud team

Results appear here.

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

Ordinary arithmetic silently stops being exact

A double precision floating point number holds integers exactly only up to about nine quadrillion, and beyond that it starts rounding to the nearest representable value with no warning at all. Adding one to that limit gives back the same number. Financial systems, cryptographic code and anything working with large identifiers hit this boundary and produce answers that look plausible and are wrong, which is far worse than an error.

Where big integers are genuinely needed

RSA and Diffie-Hellman operate on numbers of two thousand bits and more, where every digit matters and a single rounding error destroys the result. Combinatorics produces enormous values from small inputs: the factorial of 100 has 158 digits. Hash values, database identifiers and accounting totals in minor units all routinely exceed what a double can hold exactly, and in each case an approximate answer is useless.

Cost grows with the number of digits

Adding two numbers costs time proportional to their length. Schoolbook multiplication costs the product of the two lengths, which is why multiplying two thousand digit numbers is noticeably slower than adding them, and why cryptographic libraries use asymptotically faster algorithms such as Karatsuba and FFT based multiplication for large operands. Factorials grow fastest of all: the factorial of ten thousand has more than thirty five thousand digits.

Related tools

  • Percentage Calculator — Calculate percentages, percentage change, increase and decrease, and reverse percentages, with the working shown for each result.
  • Statistical Calculator — Calculate mean, median, mode, standard deviation, and more.
  • Probability Calculator — Calculate probabilities for single and combined events, including conditional probability and Bayes' theorem.
  • Scientific Calculator — Perform advanced mathematical operations including trig, log, and exponents.

Frequently Asked Questions

When does ordinary arithmetic stop being exact?

Above about nine quadrillion, which is two to the power fifty three. Beyond that a double precision number rounds to the nearest value it can represent, silently, so adding one can give back the same number.

Why do cryptographic systems need this?

Because RSA and Diffie-Hellman work with numbers of two thousand bits or more, and every digit affects the result. A single rounded digit produces a value that is simply wrong, with no indication that anything went astray.

How large can the numbers be?

Limited only by memory and patience. Numbers with tens of thousands of digits are handled quickly; multiplication of very large operands slows noticeably because the cost grows with the product of the two lengths.

Why is division different for integers?

Because exact integer division gives a quotient and a remainder rather than a fraction. Both are shown, along with the decimal approximation, since which one is wanted depends entirely on the problem.

Is a factorial of a large number practical?

Up to a few tens of thousands, yes, though the results are enormous: the factorial of one hundred has 158 digits and the factorial of ten thousand has more than thirty five thousand. The digit count is reported so the scale is visible before the number is.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Enter two whole numbers of any length and choose an operation.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.