Euler Totient CalculatorFree online math calculator — instant results, no sign-up

Count positive integers up to n that are relatively prime to n.

Inputs

Result
12

Sign in to save results and favorites.

About the Euler Totient Calculator

The Euler Totient Calculator counts the positive integers up to and including n that are relatively prime to n, meaning their greatest common divisor with n is 1. It returns Euler’s totient function, φ(n). With the default input of 36, the result is 12.

Positive integer
The dimensionless positive whole number n whose relatively prime integers are counted, with a default value of 36.

Formula and method

φ(n) = n × ∏_{p | n}(1 − 1/p); for n = 36 = 2² × 3², φ(36) = 36 × (1 − 1/2) × (1 − 1/3) = 12.
  • nThe positive integer entered into the calculator.
  • φ(n)The number of integers k with 1 ≤ k ≤ n and greatest common divisor gcd(k, n) = 1.
  • pA distinct prime divisor of n.
  • ∏_{p | n}Multiply one factor for each distinct prime p that divides n.

Find the distinct prime factors of n, then multiply n by (1 − 1/p) for each of those primes. This removes integers sharing a prime factor with n while accounting for overlaps. For 36, the distinct prime factors are 2 and 3, so the calculation is 36 × (1/2) × (2/3) = 12. For n = 1, the product has no factors and φ(1) = 1.

Worked example

These are the calculator's starting values and the results it actually produces for them.

Inputs

  • Positive integer36

Results

  • Result12

How to use the Euler Totient Calculator

  1. 1Enter 36 in the Positive integer field, or leave the default value unchanged.
  2. 2Confirm that the input is a positive whole number, not zero, a negative number, or a fraction.
  3. 3Run the calculation to evaluate Euler’s totient function.
  4. 4Review the calculation: 36 = 2² × 3², so φ(36) = 36 × (1 − 1/2) × (1 − 1/3).
  5. 5Read Result = 12 as the count of positive integers up to 36 that are relatively prime to 36.

Reading your result

The Result row reports φ(n), a dimensionless integer count—not a percentage or a list of prime numbers. For the default input, Result = 12 means exactly 12 integers from 1 through 36 have greatest common divisor 1 with 36: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, and 35.

Limitations

The calculation assumes n is a positive integer; zero, negative values, fractions, and nonnumeric input are outside this tool’s stated domain. The mathematical result is exact, but factoring very large integers can be computationally expensive, and supported input size depends on the implementation. The output counts relatively prime integers; it does not count only primes or necessarily display the qualifying integers.

Common questions

Why is φ(36) equal to 12?+

An integer is relatively prime to 36 precisely when it is divisible by neither 2 nor 3. Among the integers from 1 through 36, inclusion–exclusion gives 36 − 18 − 12 + 6 = 12 qualifying integers.

Why are the prime factors 2 and 3 used only once for 36?+

Although 36 = 2² × 3², being divisible by 2 or by 3 already prevents an integer from being relatively prime to 36. The totient product therefore uses each distinct prime divisor once; the powers are already included in n.

Does the totient count include 1 or n itself?+

It always includes 1 because gcd(1, n) = 1. It excludes n when n > 1 because gcd(n, n) = n. By convention and the stated counting definition, φ(1) = 1.

Must an integer counted by φ(36) be prime?+

No. Relative primality concerns shared factors with 36, not whether an integer is prime. For example, 25 and 35 are composite but share no prime factor with 36, so both are counted.

Does the calculator save my information?+

Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.

You might also like

Results are estimates for informational purposes and are not financial, medical or legal advice.