What this calculator does
This tool builds a table of values and a graph for a logarithm function over a range of x values. You can choose the natural logarithm \(\ln(x)\) (base e), the common logarithm \(\log(x)\) (base 10), or a logarithm to any base a, written \(\log_a(x)\). For each x stepping from your start value to your end value by a fixed increment, it computes \(y = f(x)\), lists the (x, y) pairs, and plots the resulting curve.
How to use it
Pick the function from the dropdown. If you select \(\log_a(x)\), enter the base a (it must be greater than 0 and not equal to 1). Set "Range x (from)" and "Range x (to)" plus the "Increment" (step). Choose how many significant digits to display. The calculator iterates through the range, skipping any x value that is zero or negative because the logarithm is undefined there. To keep things responsive the table is capped at 301 rows.
The formula
The natural logarithm \(y = \ln(x)\) is the inverse of \(e^x\). The common logarithm is $$y = \log_{10}(x) = \frac{\ln(x)}{\ln(10)}.$$ For an arbitrary base a, the change-of-base formula gives $$\log_a(x) = \frac{\ln(x)}{\ln(a)}.$$ Internally Math.log is the natural log and Math.log10 is base 10. Because \(\ln(a) = 0\) when \(a = 1\), a base of exactly 1 is rejected to avoid division by zero.
Worked example
Choose \(\log_a(x)\) with \(a = 2\), x from 1 to 8, step 1. The change-of-base formula gives: $$\log_2(1)=0,\quad \log_2(2)=1,\quad \log_2(3)=1.584963,\quad \log_2(4)=2,\quad \log_2(5)=2.321928,\quad \log_2(6)=2.584963,\quad \log_2(7)=2.807355,\quad \log_2(8)=3.$$ All 8 rows are defined (every x is positive), so the table has 8 rows and 8 plotted points, with the first point at (1, 0).
Common Logarithm Values and Key Properties
The table lists the natural logarithm, the base-10 logarithm and the base-2 logarithm of some frequently used x values (rounded to 6 decimals). Here e ≈ 2.71828.
| x | ln(x) | log10(x) | log2(x) |
|---|---|---|---|
| 0.1 | −2.302585 | −1 | −3.321928 |
| 0.5 | −0.693147 | −0.301030 | −1 |
| 1 | 0 | 0 | 0 |
| 2 | 0.693147 | 0.301030 | 1 |
| e ≈ 2.71828 | 1 | 0.434294 | 1.442695 |
| 10 | 2.302585 | 1 | 3.321928 |
| 100 | 4.605170 | 2 | 6.643856 |
| 1000 | 6.907755 | 3 | 9.965784 |
Key properties
For a base a with a > 0 and a ≠ 1, and for x, y > 0:
- \(\log_a(1) = 0\)
- \(\log_a(a) = 1\)
- Product rule: \(\log_a(xy) = \log_a x + \log_a y\)
- Quotient rule: \(\log_a(x/y) = \log_a x - \log_a y\)
- Power rule: \(\log_a(x^n) = n \cdot \log_a x\)
- Change of base: \(\log_a x = \dfrac{\ln x}{\ln a}\)
Reading the Table and Graph
- Domain and range: the function is defined only for x > 0. Its outputs cover all real numbers. If your x range includes 0 or negative values, those rows have no real result.
- Fixed point: every logarithm graph passes through (1, 0), because \(\log_a(1) = 0\) for any valid base.
- Increasing or decreasing: for a > 1 the curve rises as x grows. For 0 < a < 1 it falls.
- Vertical asymptote: the line x = 0 is a vertical asymptote. As x approaches 0 from the right, the values go to −∞ when a > 1 (and to +∞ when 0 < a < 1).
- Slowing growth: for a > 1 the curve keeps rising but ever more slowly. Each time x is multiplied by the base, y goes up by just 1. For example, log10 goes from 2 to 3 when x goes from 100 to 1000.
- Effect of the base: for x > 1 and a > 1, a larger base gives a flatter curve with smaller values. For example, at x = 100, log2 is about 6.64, ln is about 4.61 and log10 is 2.
- Mirror images: \(\log_{1/a}(x) = -\log_a(x)\), so the graphs of base a and base 1/a are reflections of each other across the x-axis.
- Inverse of the exponential: the graph of \(y = \log_a x\) is the reflection of \(y = a^x\) across the line y = x. Points (p, q) on one curve correspond to points (q, p) on the other.
- Step size: a smaller step gives a smoother graph. Use small steps near x = 0, where the curve changes quickly.
Key Terms
- Logarithm
- The exponent to which a base must be raised to produce a given number: \(\log_a x = y\) means \(a^y = x\).
- Base
- The number a being raised to a power in a logarithm. It must be positive and not equal to 1.
- Natural logarithm
- The logarithm with base e ≈ 2.718281828, written ln(x).
- Common logarithm
- The logarithm with base 10, written log(x) or log10(x).
- Change-of-base formula
- \(\log_a x = \dfrac{\ln x}{\ln a} = \dfrac{\log_{10} x}{\log_{10} a}\). It lets you compute a logarithm in any base from ln or log10.
- Domain
- The set of allowed inputs. For a real logarithm this is x > 0.
- Vertical asymptote
- A vertical line that the graph approaches but never touches. For a logarithm it is x = 0.
- Increment (step)
- The spacing between consecutive x values in the table, for example a step of 0.5 gives x = 0.5, 1, 1.5, and so on.
- Significant digits
- The meaningful digits of a number, counted from the first non-zero digit. They set how precisely the results are rounded.
FAQ
Why is x = 0 shown as undefined? The logarithm of zero tends to negative infinity, and logs of negative numbers are not real, so those rows are flagged undefined and not plotted; the y-axis behaves as a vertical asymptote.
Can the base be a fraction? Yes. Any a with \(0 < a < 1\) (such as 0.5) is valid and produces a decreasing curve. Only \(a = 1\) and \(a \le 0\) are disallowed.
What does "significant digits" change? It only affects how many figures are shown in the table; the underlying math is always full double precision.