Factorial Calculator
Enter a non-negative whole number and get its factorial computed exactly, with the digit count, scientific notation, and trailing zeros, updated as you type.
Enter a non-negative whole number. 0 returns 1. Everything is calculated in your browser. Nothing is uploaded.
A higher maximum lets you compute a bigger factorial but can take a moment to display very long numbers.
How to calculate a factorial online
Enter n
Type a non-negative whole number for n, from 0 up to the maximum you choose.
Read the exact factorial
The exact value of n! appears the moment you type, with no button to press.
Copy or check the stats
Copy the full number and read its digit count, scientific notation, and trailing zeros.
Why use this tool
Exact result for large numbers
n! is worked out with exact whole-number arithmetic, so even factorials with thousands of digits are correct to the last digit rather than rounded to an approximation.
Digits, scientific notation, and trailing zeros
Alongside the full number you get how many digits it has, a scientific-notation approximation, and the count of trailing zeros that end the value.
Adjustable safe limit
A maximum value for n keeps the page responsive. Raise the limit when you need a bigger factorial, or lower it to keep very long numbers from slowing the tab.
Clear guards for invalid input
Negative numbers and fractions are rejected with a plain message, and 0 correctly returns 1 by definition instead of an error.
Runs entirely in your browser
Everything is calculated on your device. The numbers you enter are never uploaded, stored, or logged.
About this tool
The factorial calculator multiplies every whole number from 1 up to n to give n!, the value used throughout counting problems, probability, and series. Enter a non-negative integer and the result appears at once, with no button to press. Because factorials grow extremely fast, the value is worked out with exact whole-number arithmetic, so a result with hundreds or thousands of digits is correct to the final digit instead of being rounded to a floating-point approximation.
Along with the full number you get three things that are hard to read off a giant integer by eye: the total digit count, a scientific-notation approximation such as 9.3326 times ten to the power 157, and the number of trailing zeros, which is set by how many times five divides into the factorial. The value 0! is defined as 1, and the tool follows that convention. Negative numbers and fractions have no factorial in the ordinary sense, so they are rejected with a short message rather than a wrong answer.
A maximum for n keeps a single tab responsive, since displaying a number with hundreds of thousands of digits takes real work. You can raise the limit when you need a bigger factorial or lower it for speed. For related counting math, try the permutation and combination calculator; to raise a base to a power, see the exponent calculator; and for step-by-step arithmetic, the scientific calculator is next door. Everything here runs in your browser and nothing is uploaded.
Frequently asked questions
- What is a factorial?
- A factorial, written n!, is the product of every whole number from 1 up to n. For example 5! is 5 by 4 by 3 by 2 by 1, which is 120. Factorials count the number of ways a set of items can be arranged in order.
- What is 0 factorial?
- 0! is defined to equal 1. It stands for the single way to arrange an empty set, and this convention keeps the formulas for permutations and combinations consistent. The calculator returns 1 for an input of 0.
- How large a factorial can it compute?
- You choose a maximum for n. A factorial can have hundreds of thousands of digits, so a limit keeps the page responsive. Raise the limit when you need a larger factorial and lower it when you want very long numbers to display faster.
- Why are negative numbers and decimals rejected?
- A factorial is only defined for non-negative whole numbers. Fractions and negative values have no factorial in this ordinary sense, so they are rejected with a message instead of returning a misleading result.
- How are the trailing zeros counted?
- Trailing zeros come from factors of ten, and each ten needs a five paired with a two. Because twos are far more common than fives in a factorial, the number of trailing zeros equals how many times five divides into the numbers from 1 up to n.
- Is my data uploaded anywhere?
- No. Everything runs in your browser; nothing is sent to a server. The numbers you enter are never uploaded, stored, or logged.
Related tools
Permutation and Combination Calculator
Enter n and r to get the number of permutations and combinations, plus the factorials behind them.
Exponent Calculator
Raise any base to a power and get the result, its expanded form, scientific notation, and roots, updated as you type.
Scientific Calculator
Type a full expression with trigonometry, logarithms, powers, roots, and factorials, and see the result update live as you go.
401(k) Calculator
Project your 401(k) balance at retirement from your contributions, employer match, and expected return, year by year.
Amortization Schedule Calculator
Build a full payment-by-payment schedule for any fixed-rate loan, with the payoff date and the interest you save by paying extra.
APY Calculator
Turn a nominal rate and compounding frequency into the true annual percentage yield, project a balance, or reverse solve the rate.