Math

Euler Totient Calculator

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

Exact method explained belowEditable inputs
Calculation notebook
Calculation notebook

The formula and worked example below explain the calculation.

See the method

Enter your values

Runs on your device

Your answer

Your result

Let’s calculate.

Use the Calculate button to see your result.

Review the method below for assumptions and conventions.

How to use this tool

  1. Enter positive integer n.
  2. Select Calculate to view the result.
  3. Check the method and assumptions below before using the result.

The method, explained

Start with φ(n)=n. For each distinct prime factor p, multiply by (1−1/p). The special value φ(1) is one.

A WORKED EXAMPLE

Using positive integer n = 36, the result is 12. Change these example inputs to match your task; use the method above to check each step.

Understanding your result

Only numbers sharing no factor with n other than one are counted. For a prime p, every positive integer below p qualifies, giving φ(p)=p−1.

What to keep in mind

Positive integers through ten billion. The result is a count, not a probability. Finite-precision arithmetic is used. Check the domain and the stated convention before using an approximation.

Common questions

Are all numbers smaller than n counted?

Only numbers sharing no factor with n other than one are counted. For a prime p, every positive integer below p qualifies, giving φ(p)=p−1.

How can I check the result?

Start with φ(n)=n. For each distinct prime factor p, multiply by (1−1/p). The special value φ(1) is one. The worked example uses editable inputs. Calculations run on your device; no external API or account is required.

Methodology maintained by ClarityKit. How these tools are built and checked.