Harmonic Series Calculator

Sum the first n unit fractions and compare with the standard log estimate.

Math and PercentUpdated 2026-11-192 min read
Harmonic Series Calculator
A whole number from 1 to 1,000,000.
Harmonic number H(n)
...
Log estimate...
Estimate error...

What it does

The harmonic series adds the reciprocals of the counting numbers. Its partial sums are called harmonic numbers. They grow forever, yet so slowly that the first ten terms only reach about 2.93.

This tool adds the terms directly and then shows the standard log estimate. Seeing both values and their difference makes the growth rate concrete and shows how fast the approximation settles down as n increases.

Harmonic numbers appear in algorithm analysis, record statistics, and problems about collecting a full set of items or waiting for a rare event. The slow growth is the point: doubling n adds only about 0.69 to the sum.

There is no simple closed form for a harmonic number, so a direct sum or an estimate is the practical route. The estimate uses the natural log, the Euler-Mascheroni constant, and one small correction term.

How to use

  1. Enter the number of terms to add.
  2. Read the exact partial sum in the main result.
  3. Compare it with the log estimate below.
  4. Check the error line to see how close the estimate came.
  5. Raise n and watch both values grow at nearly the same pace.
  6. Try n = 1 to confirm the first harmonic number is exactly 1.

Formula

H(n) = sum from k = 1 to n of 1/k, approximately ln n + gamma + 1/(2n).
H(n)
The nth harmonic number, the sum of reciprocals up to n.
n
A positive whole number of terms.
gamma
The Euler-Mascheroni constant, about 0.5772156649.

The estimate comes from the Euler-Maclaurin expansion. Adding 1/(2n) makes it far sharper than ln n + gamma on its own, and the remaining error stays below roughly 1/(12 n squared). Gamma has no known simple fraction; the tool carries about sixteen digits. For the first terms the direct sum is exact by construction, and the error line simply measures the estimate against it.

Worked example

Example: the tenth harmonic number

Ten terms, with n = 10.

  1. Add 1 + 1/2 + ... + 1/10.
  2. The exact partial sum is 2.928968.
  3. ln 10 = 2.302585.
  4. Add gamma: 2.302585 + 0.577216 = 2.879801.
  5. Add 1/(2n) = 0.05 to reach 2.929801.
  6. Difference from the exact sum: 0.000833.
  7. Tool reports 2.928968 with an error line of 0.000833.

Reference table

Harmonic numbers and their log estimates
nH(n)ln n + gamma + 1/(2n)
111.077216
52.2833332.286654
102.9289682.929801
1005.1873785.187386
10007.4854717.485471

Limits

  • The sum is finite only because n is finite; the infinite series diverges.
  • Direct summation is capped at one million terms to keep the page responsive.
  • The estimate is an approximation, not the exact partial sum.
  • Floating point rounding grows slightly with very large term counts.

Common mistakes

  • Confusing the harmonic series with the harmonic mean.
  • Expecting the partial sums to settle toward a fixed limit.
  • Using log base 10 instead of the natural log in the estimate.
  • Dropping the 1/(2n) term and wondering why the error is larger.
  • Reading the error column as a percentage.

Try it yourself

Quick checks. Answers sit tucked under each question.

What are the first four terms of the harmonic series?

1 + 1/2 + 1/3 + 1/4 = 2.083333.

Approximate H(10) with the log estimate.

ln 10 + 0.577216 + 0.05 = 2.929801.

Does the infinite harmonic series converge?

No. It grows without bound, though very slowly.

Questions

What is a harmonic number?

The sum of the reciprocals from 1 up to n.

Does the harmonic series converge?

No, the partial sums grow forever.

What is gamma?

The Euler-Mascheroni constant, about 0.577216.

How accurate is the log estimate?

Very good for moderate n, and the tool prints the exact error.

Why does doubling n add about 0.69?

Because the sum tracks the natural log, and ln 2 is about 0.693.

Where do harmonic numbers show up?

In algorithm costs, record values, and waiting-time problems.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.