Euler totient function calculator

Count positive integers up to n relatively prime to n, for n up to one billion.

Enter values

Start with the example below, or enter your own values.

How it works

Factor n and multiply n by (1−1/p) for each distinct prime divisor; φ(1)=1.

Try an example

Positive integer: 36. The form starts with these values; change them to explore your own case.

Example result: 12

  1. Apply φ(n)=n ∏(1−1/p) over distinct prime factors.

Learn more in Exact number theory and congruences.

Results are calculated locally. Floating-point tools provide numerical approximations, not formal proof certificates.