Euler's Totient Function (φ) Calculator

Enter an integer N (1 to 1,000,000) to instantly find the number of integers from 1 to N that are coprime to N (Euler's totient function φ(N)), with prime factorization and the formula used. Includes a φ(n) reference table for 1-100.

φ(n) reference table for 1-100

A reference table showing the prime factorization and Euler totient value for every integer from 1 to 100.

N Factorization φ(n)
1 1 1
2 2 1
3 3 2
4 2
5 5 4
6 2 × 3 2
7 7 6
8 4
9 6
10 2 × 5 4
11 11 10
12 2² × 3 4
13 13 12
14 2 × 7 6
15 3 × 5 8
16 2⁴ 8
17 17 16
18 2 × 3² 6
19 19 18
20 2² × 5 8
21 3 × 7 12
22 2 × 11 10
23 23 22
24 2³ × 3 8
25 20
26 2 × 13 12
27 18
28 2² × 7 12
29 29 28
30 2 × 3 × 5 8
31 31 30
32 2⁵ 16
33 3 × 11 20
34 2 × 17 16
35 5 × 7 24
36 2² × 3² 12
37 37 36
38 2 × 19 18
39 3 × 13 24
40 2³ × 5 16
41 41 40
42 2 × 3 × 7 12
43 43 42
44 2² × 11 20
45 3² × 5 24
46 2 × 23 22
47 47 46
48 2⁴ × 3 16
49 42
50 2 × 5² 20
51 3 × 17 32
52 2² × 13 24
53 53 52
54 2 × 3³ 18
55 5 × 11 40
56 2³ × 7 24
57 3 × 19 36
58 2 × 29 28
59 59 58
60 2² × 3 × 5 16
61 61 60
62 2 × 31 30
63 3² × 7 36
64 2⁶ 32
65 5 × 13 48
66 2 × 3 × 11 20
67 67 66
68 2² × 17 32
69 3 × 23 44
70 2 × 5 × 7 24
71 71 70
72 2³ × 3² 24
73 73 72
74 2 × 37 36
75 3 × 5² 40
76 2² × 19 36
77 7 × 11 60
78 2 × 3 × 13 24
79 79 78
80 2⁴ × 5 32
81 3⁴ 54
82 2 × 41 40
83 83 82
84 2² × 3 × 7 24
85 5 × 17 64
86 2 × 43 42
87 3 × 29 56
88 2³ × 11 40
89 89 88
90 2 × 3² × 5 24
91 7 × 13 72
92 2² × 23 44
93 3 × 31 60
94 2 × 47 46
95 5 × 19 72
96 2⁵ × 3 32
97 97 96
98 2 × 7² 42
99 3² × 11 60
100 2² × 5² 40

Tips

  • Euler's totient function φ(n) counts the integers from 1 to n that are coprime to n. For example, φ(9) = 6 (1, 2, 4, 5, 7, and 8 are coprime to 9).
  • When n is a prime p, φ(p) = p − 1, because every number from 1 to p except p itself is coprime to a prime.
  • When n is the product of two distinct primes p and q, φ(pq) = (p−1)(q−1) — a property used directly in RSA key generation.
  • The formula φ(n) = n × Π(1 − 1/p) is a product over the distinct prime factors p of n; the exponent of each prime does not affect the result.
  • This tool supports the range 1 to 1,000,000 and computes φ(n) instantly using trial-division factorization.

Frequently Asked Questions

Beyond its role in foundational number theory, it is central to cryptography, especially RSA key generation. The RSA private key is derived using φ(n) = (p−1)(q−1).

By convention, φ(1) = 1. Although 1 is the only integer up to 1 that could be considered, defining φ(1) = 1 keeps the function's multiplicative properties consistent, which is the standard mathematical convention.

Yes. Since a prime p has no divisors other than 1 and itself, every integer from 1 to p except p is coprime to it, so φ(p) = p − 1.

RSA uses a composite number n = pq, the product of two large primes, as part of the public key. Computing the private key requires φ(n) = (p−1)(q−1), but φ(n) cannot be found without factoring n — this difficulty of factoring large numbers is the foundation of RSA's security.
ツールくん

Side Note — The 18th-century function that counts what's coprime

Euler's totient function was introduced around 1763 by the Swiss mathematician Leonhard Euler, originally while generalizing Fermat's little theorem to composite numbers. The now-standard symbol φ (phi) was adopted later by other mathematicians who systematized the notation.

Counting coprime numbers may sound like a simple exercise, but φ(n) has several elegant properties. For instance, summing φ(d) over every divisor d of n always equals n itself (Σφ(d) = n) — one of the fundamental identities in elementary number theory.

Today, φ(n) plays an essential role in RSA cryptography. RSA uses the product of two large primes n = pq as part of the public key, and computing the private key requires φ(n) = (p−1)(q−1). The fact that φ(n) cannot be computed without factoring n (at least with currently known algorithms) is one of the pillars underlying RSA's security.