Logarithmic Mean Calculator
Means
- The logarithmic mean of two different positive numbers is L = (a - b) / ln(a / b); it is the mean that makes heat-exchanger LMTD calculations exact.
- With a = 80 and b = 40: L = (80 - 40) / ln(80 / 40) = 57.71.
- The arithmetic mean is 60.00 and the geometric mean 56.57.
- The three means always order as geometric <= logarithmic <= arithmetic, with equality only when a = b - a useful check on any LMTD result.
This Logarithmic Mean Calculator finds the logarithmic mean of two different positive numbers using L = (a - b) / ln(a / b); when the two numbers are equal, the answer is simply that number. Enter your values and the calculator returns the result at once. For example, the logarithmic mean of 80 and 40 is 57.71, which sits between the geometric mean of 56.57 and the arithmetic mean of 60. For 100 and 20, the logarithmic mean is 49.71, against a geometric mean of 44.72 and an arithmetic mean of 60. The three means always order as geometric, then logarithmic, then arithmetic, with equality only when a = b, so the logarithmic mean always falls in that middle position.
The logarithmic mean is not an arbitrary average: it is the exact mean temperature difference in a heat exchanger, known as the LMTD, which is why it appears throughout thermal engineering. That exactness is what makes this method the accepted standard for this kind of calculation rather than an approximation. This page shows the formula, step-by-step workings, worked examples and sources, so you can check every number yourself instead of trusting a black box. Whether you are sizing heat-transfer equipment or comparing averages, you get the same result the engineering standard calls for, with the reasoning laid out in full.
Worked examples
Heat exchanger ends at 80 and 40
(80 · 40)
| logarithmic mean | 57.71 |
| arithmetic mean | 60.00 |
| geometric mean | 56.57 |
| ordering check | geometric < logarithmic < arithmetic |
Wide spread: 100 and 20
(100 · 20)
| logarithmic mean | 49.71 |
| arithmetic mean | 60.00 |
| geometric mean | 44.72 |
| ordering check | geometric < logarithmic < arithmetic |
Equal values: 60 and 60
(60 · 60)
| logarithmic mean | 60.00 |
| arithmetic mean | 60.00 |
| geometric mean | 60.00 |
| ordering check | all three means are equal |
What is the logarithmic mean?
The logarithmic mean is a way of averaging two positive numbers that sits between two more familiar averages: the geometric mean and the arithmetic mean. For two different positive numbers a and b, it is defined as L = (a - b) / ln(a / b), where ln is the natural logarithm. The formula divides the plain difference between the numbers by the natural log of their ratio. When the two numbers are equal, the ratio a / b is 1, ln(1) is 0, and the division breaks down; in that case the logarithmic mean is defined as the number itself, which is also the value the formula approaches as a and b get closer together.
A worked example makes the idea concrete. Take a = 80 and b = 40. The difference is 40, and the ratio 80 / 40 is 2, whose natural log is about 0.6931. Dividing 40 by that value gives L(80, 40) = 57.71. That result falls between the geometric mean of 56.57 (the square root of 80 times 40) and the arithmetic mean of 60 (half of 80 plus 40). So for these two numbers the three averages line up as 56.57, then 57.71, then 60.
A wider gap between the inputs spreads the three means further apart. For a = 100 and b = 20, the logarithmic mean is L(100, 20) = 49.71. The geometric mean is 44.72 and the arithmetic mean is 60. Notice that the logarithmic mean stays closer to the geometric mean than to the arithmetic mean, and that the spacing grows as the two numbers become more unequal. The ordering itself never changes: the three means always run geometric first, then logarithmic, then arithmetic, and they coincide only when a = b.
This ordering is one reason the logarithmic mean is useful: it gives a single number that respects both the size and the ratio of the inputs, without being pulled as far upward as the arithmetic mean by a large value. It is a standard average in its own right, and it appears wherever a quantity depends on a difference divided by a log ratio.
The most prominent application is in thermal engineering. The logarithmic mean is the exact mean temperature difference in a heat exchanger, known as the LMTD, which is why it appears throughout that field. In that setting, the two numbers being averaged are temperature differences at the two ends of the exchanger, and the LMTD summarizes them into one effective driving temperature for the heat transfer calculation.
Why engineers use it: LMTD
In a heat exchanger, two fluids at different temperatures flow past each other, and heat moves from the hotter stream to the colder one. The rate of that heat transfer depends on the temperature difference between the two streams — but that difference is not constant along the length of the exchanger. As the hot fluid cools and the cold fluid warms, the gap between them shrinks. Engineers need a single representative temperature difference to put into the heat-transfer equation, and the logarithmic mean is the one that gives the exact answer. That quantity is called the log mean temperature difference, or LMTD, and it is why the logarithmic mean appears throughout thermal engineering.
The temptation is to average the two end differences arithmetically. Suppose the temperature differences at the two ends of an exchanger are 100 and 20. The arithmetic mean is 60. The logarithmic mean, computed as L = (a - b) / ln(a / b), gives L(100, 20) = 49.71. That is a gap of more than ten degrees, and it is not a rounding quirk — it reflects how the driving force actually behaves. Because heat transfer falls off as the temperature difference shrinks, the cooler end of the exchanger contributes less than a straight-line average would suggest. Using 60 instead of 49.71 overstates the driving force, and an exchanger sized on the arithmetic mean would come out too small for the duty it has to perform.
A second example makes the pattern clearer. With end differences of 80 and 40, the logarithmic mean is L(80, 40) = 57.71. The geometric mean of the same pair is 56.57 and the arithmetic mean is 60. The logarithmic mean sits between them, closer to the geometric value. This ordering is not a coincidence of these numbers: the three means always order as geometric, then logarithmic, then arithmetic, and they coincide only when the two values are equal. The wider the spread between the two end differences, the further the arithmetic mean drifts above the logarithmic mean, and the larger the error from treating the average as a simple midpoint.
That is the practical reason the logarithmic mean is the standard tool here. It is the exact mean temperature difference in a heat exchanger — the LMTD — not an approximation chosen for convenience. When the two end differences are close together, all three means nearly agree and the choice hardly matters. When they are far apart, as in the 100-and-20 case, the arithmetic mean can overstate the driving force substantially, leading to an undersized unit or an optimistic performance estimate. The logarithmic mean keeps the calculation honest across the full range.
The three means compared
Two worked pairs make the differences between the three means easy to see. For 80 and 40, the logarithmic mean is L(80, 40) = 57.71, sitting between the geometric mean of 56.57 and the arithmetic mean of 60. For 100 and 20, the gap widens: the logarithmic mean is L(100, 20) = 49.71, against a geometric mean of 44.72 and an arithmetic mean of 60. In both cases the logarithmic mean falls strictly between the other two, closer to the geometric mean than to the arithmetic one.
The ordering is not a coincidence of these two examples. The three means always order as geometric, then logarithmic, then arithmetic, with equality only when a = b. When the two numbers are equal, all three collapse to that single number; as soon as they differ, the geometric mean is the smallest and the arithmetic mean the largest, with the logarithmic mean held between them. For 80 and 40 the spread from geometric to arithmetic mean is 56.57 to 60, and the logarithmic mean of 57.71 sits inside that band. For 100 and 20 the band is much wider, 44.72 to 60, and the logarithmic mean of 49.71 again sits inside it, though nearer the lower end.
The formula behind the middle value is L = (a - b) / ln(a / b) for two different positive numbers; for equal numbers it is the number itself. That division by a logarithm is what pulls the result below the arithmetic mean, which simply averages the two inputs, while keeping it above the geometric mean, which multiplies them and takes a root. The wider the ratio between the two numbers, the more the logarithmic mean separates from the arithmetic mean, as the 100 and 20 row shows.
This middle position is why the logarithmic mean matters in practice. It is the exact mean temperature difference in a heat exchanger, the LMTD, which is why it appears throughout thermal engineering. Engineers who reach for an arithmetic average of inlet and outlet temperatures overstate the driving force; the logarithmic mean gives the correct figure, and the ordering above shows by how much the arithmetic mean can mislead when the two temperatures are far apart.
The table below collects the two worked pairs side by side so the ordering can be checked at a glance.
| Pair (a, b) | Geometric mean | Logarithmic mean | Arithmetic mean |
|---|---|---|---|
| 80, 40 | 56.57 | 57.71 | 60 |
| 100, 20 | 44.72 | 49.71 | 60 |
Edge cases
The formula L = (a - b) / ln(a / b) only works when a and b are different. If you plug in two equal numbers, the numerator becomes zero and the denominator becomes ln(1), which is also zero. You get 0/0, an expression a calculator cannot evaluate directly. The logarithmic mean handles this case with a limit: as the two numbers get closer together, L approaches the shared value. So for a = b = 60, the logarithmic mean is simply 60. The same holds for any equal pair — the mean is the number itself.
Both numbers must also be positive, and strictly so. The formula divides by ln(a / b), and the logarithm is only defined for positive arguments, so a / b must be greater than zero. If either a or b is negative or zero, the ratio can be zero or negative and the logarithm breaks down. There is no logarithmic mean of, say, 50 and 0, or of -10 and 20, in the usual sense. When you use the calculator, enter two positive values; a zero or a negative number is outside the domain, not a result you should expect to round.
The equal case is not a quirk to work around — it is the one point where the logarithmic mean coincides with the geometric and arithmetic means. For any two different positive numbers, the three means always order as geometric, then logarithmic, then arithmetic, with equality only when a = b. Take 80 and 40: the geometric mean is 56.57, the logarithmic mean is 57.71, and the arithmetic mean is 60. The logarithmic mean sits neatly between the other two. With 100 and 20 the same ordering holds: geometric 44.72, logarithmic 49.71, arithmetic 60. Push the two inputs together and all three values converge on the same number, which is exactly what the a = b limit describes.
These edge cases matter in practice because the logarithmic mean is the exact mean temperature difference in a heat exchanger — the LMTD — which is why it appears throughout thermal engineering. In that setting, a hot and cold stream at the same temperature would mean no heat transfer and a zero temperature difference, the degenerate case where the limit gives the shared temperature. Real calculations almost always use two different temperatures, but knowing the boundary keeps your results honest: positive inputs only, and a defined answer even when the two values match.
A quick check before you trust any output: confirm both numbers are greater than zero, and confirm that if they are equal, the answer equals that number rather than an error. Those two rules cover every input the logarithmic mean can accept.
FAQs
What is the logarithmic mean of 80 and 40?
The logarithmic mean of 80 and 40 is 57.71. That value sits between the geometric mean of 56.57 and the arithmetic mean of 60, which is exactly where a logarithmic mean should fall. It is lower than the arithmetic mean because the logarithmic mean gives less weight to the larger value.
What is the formula for the logarithmic mean?
For two positive values a and b that are not equal, the logarithmic mean is L = (a - b) / ln(a / b). The formula divides the difference of the two values by the natural logarithm of their ratio. If a equals b, the logarithmic mean is simply that shared value.
Why is the logarithmic mean used in heat exchangers?
In a heat exchanger, the temperature difference between the two streams changes exponentially along the length of the exchanger. Because of that exponential variation, the true average temperature difference is the logarithmic mean, known as the LMTD. Using it gives a more accurate average than a simple arithmetic mean would.
Which is bigger, the logarithmic or arithmetic mean?
The arithmetic mean is always at least as large as the logarithmic mean. When the two values differ, the order from smallest to largest is the geometric mean, then the logarithmic mean, then the arithmetic mean. All three coincide only when the two values are equal.
What is the logarithmic mean of 60 and 60?
The logarithmic mean of 60 and 60 is 60. When the two values are equal, the formula's ratio is 1 and its logarithm is 0, so the general formula is not used; instead the mean is that shared value. In this case all three means coincide at 60.
Can the logarithmic mean handle zero or negative numbers?
No. The logarithmic mean is defined only for positive numbers, so negative values and a zero endpoint fall outside its definition. In practice, a zero endpoint is handled by using the other end's difference carefully or by substituting a small epsilon for the zero.