Skip to content
D DocNectar

Free Harmonic Number Calculator

Compute the nth harmonic number H_n = 1 + 1/2 + ... + 1/n, with the exact sum and the ln(n) + γ approximation.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

The nth harmonic number, H_n = 1 + 1/2 + 1/3 + ... + 1/n, is the sum of the reciprocals of the first n positive integers. Despite each added term getting smaller and smaller, the harmonic series famously diverges — H_n grows without bound as n increases, just extremely slowly (logarithmically). Harmonic numbers show up in the analysis of algorithms (the expected running time of quicksort and several other classic algorithms involves H_n), in physics (overtones of a vibrating string relate to reciprocals of integers), and in probability (the "coupon collector's problem," which asks how many random draws are needed to collect every one of n distinct items, has an expected answer of n·H_n).

How it works

Enter n. The calculator sums 1 + 1/2 + 1/3 + ... + 1/n term by term to get the exact value, and also reports the closed-form approximation ln(n) + γ, where γ (gamma) is the Euler-Mascheroni constant. This approximation comes from comparing the discrete sum to the continuous integral ∫(1/x)dx = ln(x), and the gap between the two settles down to the constant γ as n grows large.

  1. Enter n.
  2. Click Calculate to see your results.

Examples

n = 4

H_4 = 1 + 1/2 + 1/3 + 1/4 = 12/12 + 6/12 + 4/12 + 3/12 = 25/12 ≈ 2.0833.

n = 10

H_10 = 1 + 1/2 + ... + 1/10 ≈ 2.9290. The approximation ln(10) + γ ≈ 2.3026 + 0.5772 ≈ 2.8798, already fairly close despite n being small.

Common mistakes to avoid

  • Confusing the harmonic number with the harmonic mean — they are different concepts that both involve reciprocals.
  • Assuming the harmonic series converges to a finite value like some other infinite sums do — it diverges, just very slowly.
  • Forgetting that the ln(n) + γ approximation is only close for reasonably large n; for small n the exact sum and the approximation can differ noticeably.

Frequently asked questions

The Euler-Mascheroni constant, approximately 0.5772156649 — the limiting gap between H_n and ln(n) as n grows arbitrarily large. It's one of the most important constants in mathematics whose irrationality is still not proven.
No — even though each new term 1/n shrinks toward zero, the sum H_n grows without any upper bound as n increases; it just does so extremely slowly (it takes about 12,367 terms just to exceed 10, for example).
For very large n, computing the exact sum term by term becomes computationally expensive, while ln(n) + γ gives a fast, highly accurate estimate without adding up millions of fractions.
No — that's a common mix-up. The harmonic mean of a set of numbers is n divided by the sum of their reciprocals; the harmonic number H_n is simply the sum of the reciprocals of 1 through n. They're related concepts (both built from reciprocals) but compute different things.
It asks how many random draws (with replacement) are needed on average to collect all n distinct items from a set — the expected number of draws works out to exactly n × H_n, directly tying the harmonic number to a classic probability puzzle.

Get new calculators and guides in your inbox

No spam — just new tools like Harmonic Number Calculator and practical guides.

Favorites