Euler's totient calculator

Enter a whole number n up to 10¹⁵. The calculator factors it, applies φ(n) = n·∏(1 − 1/p) and shows each prime-power step. For small n it also lists the numbers coprime to n.

A whole number from 1 to 1,000,000,000,000,000 (10¹⁵).
φ(n)192
Prime factorization
2⁴ × 3² × 5
Product formula
720 × (1 − 1/2) × (1 − 1/3) × (1 − 1/5) = 192
Steps by prime power
φ(2⁴) = 2³ × (2 − 1) = 8 φ(3²) = 3 × (3 − 1) = 6 φ(5) = (5 − 1) = 4 φ(720) = 8 × 6 × 4 = 192
n is prime (φ(n) = n − 1)
No

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type n, for example 720.
  2. Read φ(n), then the factorization and the steps. For n up to 60 the numbers coprime to n are listed too.

How it works

The tool factors n by trial division, then for each prime power pᵏ computes φ(pᵏ) = pᵏ⁻¹(p − 1) and multiplies the parts. This equals n·∏(1 − 1/p), which is also shown.

Worked example

n = 720 = 2⁴ × 3² × 5:

  • φ(2⁴) = 2³ × (2 − 1) = 8
  • φ(3²) = 3 × (3 − 1) = 6
  • φ(5) = 4
  • φ(720) = 8 × 6 × 4 = 192. Check with the product formula: 720 × ½ × ⅔ × ⅘ = 192.

Tips

Frequently asked questions

What is Euler's totient function?

φ(n) counts the integers from 1 to n whose greatest common divisor with n is 1. For example φ(10) = 4, because 1, 3, 7 and 9 are coprime to 10.

How is φ(n) calculated?

Factor n into primes, then φ(n) = n·∏(1 − 1/p) over the distinct primes p. Equivalently, φ(pᵏ) = pᵏ⁻¹(p − 1) for each prime power and the results are multiplied, because φ is multiplicative for coprime factors.

What is φ of a prime?

For a prime p every number from 1 to p − 1 is coprime to p, so φ(p) = p − 1. For example φ(97) = 96.

Where is the totient used?

Euler's theorem says aᶠ⁽ⁿ⁾ ≡ 1 (mod n) when a and n are coprime. It underlies modular inverses and the RSA cryptosystem, where φ(pq) = (p − 1)(q − 1).

Why is there a size limit?

Finding φ(n) requires factoring n, which the browser does by trial division. Up to 10¹⁵ this stays instant; the result itself is computed with big integers.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.