Example 1
- a = 3
- b = 6
4
What is the harmonic mean of 3 and 6? 4. 2×3×6/9.
Type a and b. H = 2ab/(a+b) when a+b ≠ 0. 3 and 6 give 4. 1 and 3 give 1.500000. −2 and 2 give 0.
Two numbers. A zero sum returns 0, not a blank. A fraction goes through six decimal places. An empty field leaves a blank.
Enter data and click Calculate.
The harmonic mean of two numbers is 2ab/(a+b). 3 and 6 give 36/9 = 4. 2 and 2 give 2. The engine: (a+b)!==0 ? 2*a*b/(a+b) : 0.
1 and 3 give 1.5, on the page 1.500000. −2 and 2 have sum 0, so the calculator returns 0, it does not divide by zero and does not leave a blank.
An empty field is a blank value. (a blank value+b)!==0 is true, the quotient is a blank value, the result is blank. Zero and 5 give 0, because 2×0×5/5 = 0.
The geometric mean of 4 and 9 gives 6. Arithmetic mean from a list is on the neighbouring page. Here always two numbers and 2ab/(a+b).
The header units switch does not multiply anything. 3 and 6 stay 4 whatever the label says.
3 and 6 give 4. 1 and 3 give 1.500000. −2 and 2 give 0.
H = (a+b) !== 0 ? 2ab/(a+b) : 0
The harmonic mean is 2ab/(a+b). 3 and 6 give 4. 1 and 3 give 1.500000. −2 and 2 give 0.
4
What is the harmonic mean of 3 and 6? 4. 2×3×6/9.
1.500000
What is the harmonic mean of 1 and 3? 1.500000. 6/4 and six decimal places.
0
What is the harmonic mean of −2 and 2? 0. Sum 0, the engine returns 0.
4. 2×3×6/9 = 4.
2ab/(a+b) for two numbers. When the sum is 0, the calculator returns 0.
1.500000. 6/4. A fraction through six decimal places.
0. a+b = 0, the engine does not divide.
Yes. 2ab/(a+b) = 8/4 = 2.
a blank value. The result stays blank, not the zero-sum zero.
Yes. 2×0×5/5 = 0.
Here 2ab/(a+b). There the root of the product. 4 and 9 there give 6.
No. 3 and 6 and 6 and 3 give 4.
Yes. 1.5 and 1,5 are the same number.
The calculator computes the same formula as the definition below.
Page updated in 2026.