Euler's Totient Calculator
Find Euler's totient of any positive integer.
Result
How it is calculated
Euler's totient φ(n) counts the integers from 1 to n that have no common factor with n other than 1. The tool does not test each number. It factors n and applies the product formula φ(n) = n × ∏(1 − 1/p) over each distinct prime p dividing n, using only whole-number steps. For a prime p, φ(p) = p − 1. The input is cut to a whole number and must be between 1 and 1,000,000,000. Both result fields show the same count.
Worked example
Take n = 36. Its prime factors are 2 and 3, since 36 = 2² × 3². Start with 36. For the prime 2, subtract 36 / 2 = 18, leaving 18. For the prime 3, subtract 18 / 3 = 6, leaving 12. So φ(36) = 12: the numbers 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31 and 35 share no factor with 36.
Common mistakes
- Counting each prime factor with its multiplicity. 36 = 2 × 2 × 3 × 3 uses only the distinct primes 2 and 3 in the formula.
- Assuming φ(n) = n − 1 for every n. That holds only for primes; for 36 it is 12, not 35.
- Multiplying φ values for numbers that share factors. φ(a × b) = φ(a) × φ(b) only works when a and b are coprime.
- Entering a decimal or a number above one billion. A decimal is cut to a whole number and a larger value returns nothing.
About this calculator
This calculator finds Euler's totient φ(n) — the count of positive integers from 1 to n that are coprime with n (share no common factor with n other than 1). It's computed from n's prime factorization using the product formula φ(n) = n·∏(1 − 1/p) over each distinct prime factor p of n; for a prime p itself, φ(p) = p − 1.
The totient function is central to number theory and is the mathematical foundation of the RSA public-key cryptosystem, where φ(n) (computed from two large secret primes) is used to derive the private key from the public key. It also governs Euler's theorem, a generalization of Fermat's little theorem used throughout modular arithmetic.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
For a modulus built from two distinct primes, n = p × q, the totient must equal (p − 1)(q − 1), which gives you a hand check: 77 = 7 × 11 should return 6 × 10 = 60. Keep in mind that this tool stops at one billion, far below the size of real RSA moduli, so it suits learning and homework rather than key generation. Working on a modular-arithmetic exercise? Post the n you are stuck on and the value you expected.