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.

Input reference and sample values

Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.

InputFormat and unitsSample
Positive integer nWhole numbers only. Minimum: 1.36

Result for these sample inputs

12

Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.

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.

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.