Negative Logarithm Calculator

Enter a positive number and a base to find the negative logarithm, −logb(x).

Updated

Enter to calculate Esc to clear

Negative Logarithm Calculator

Our Negative Logarithm Calculator finds −logb(x), the logarithm of x with its sign reversed, for any positive number and any valid base. It is the calculation behind pH, pOH and pKa in chemistry, absorbance in the lab and bits of information in computing. Type the number (scientific notation such as 2.5×10^-5 works) and choose a base, and the answer appears straight away with the working, a check and, for base 10, the matching pH reading.

Quick answer

The negative logarithm is the ordinary logarithm with its sign flipped: −logb(x). For example, log10(0.0001) = −4, so −log10(0.0001) = 4. Enter any positive number and base above and the calculator shows the result instantly.

  • Formula: −logb(x) = logb(1/x) = −ln(x) ÷ ln(b)
  • Sign (base > 1): positive for 0 < x < 1, zero at x = 1, negative for x > 1
  • pH: pH = −log10[H+], so [H+] = 10−4 mol/L gives pH 4
  • Not the same as: the log of a negative number, which has no real value

What Is a Negative Logarithm?

A logarithm tells you which power of the base gives a number: log10(100) = 2 because 102 = 100. The negative logarithm simply puts a minus sign in front of the answer, so −log10(100) = −2. The size stays the same; only the sign changes.

10² = 100, so
log₁₀(100) = 2
−log₁₀(100) = −2

10⁻³ = 0.001, so
log₁₀(0.001) = −3
−log₁₀(0.001) = 3

The second line shows why negative logs are useful: very small numbers such as 0.001 or 0.0000001 have negative logarithms, and flipping the sign turns them into easy positive values like 3 or 7. Do not confuse this with the logarithm of a negative number, such as log(−100), which is not a real number.

Negative Log Formula and Rules

y = −log_b(x) means b^(−y) = x

−log_b(x) = log_b(1/x)
−log_b(x) = −ln(x) ÷ ln(b)
−log_b(x) = log_(1/b)(x)
  • Reciprocal rule: −log(x) = log(1/x), so −log10(4) = log10(0.25) ≈ −0.60206.
  • Product: −log(ab) = −log(a) − log(b), so −log10(2.5 × 10−5) = 5 − log10(2.5) ≈ 4.60206.
  • Power: −log(xk) = −k log(x), so −log10(10−7) = 7.
  • Inverse: if y = −logb(x), then x = b−y.
  • Domain: x must be positive and the base must be positive and not 1.

Negative Log Table

xlog₁₀(x)−log₁₀(x)
0.001−33
0.01−22
0.1−11
0.5−0.301030.30103
100
20.30103−0.30103
101−1
1,0003−3

Each time x is divided by 10, −log10(x) goes up by exactly 1. That is why one pH unit means a tenfold change in acidity.

Graph of −log(x)

Graph of y = −log₁₀(x) (solid) and y = log₁₀(x) (dashed): mirror images across the x-axis, both crossing it at x = 1; −log₁₀(x) is positive for x between 0 and 1 and negative for x above 1 1 2 4 6 8 10 −1 1 2 (1, 0) (0.1, 1) y = −log₁₀(x) y = log₁₀(x)
  • The graph of −log(x) is the graph of log(x) reflected in the x-axis.
  • Both cross the x-axis at (1, 0), because log(1) = 0 in every base.
  • −log(x) rises steeply toward +∞ as x gets closer to 0, and keeps falling slowly as x grows.
  • It is a decreasing function: a larger x always gives a smaller −log(x).

pH and Other p-Values

In chemistry, a lowercase p means “negative base 10 logarithm of”. It turns concentrations and constants that span many powers of ten into a short scale, usually from 0 to 14 for pH:

pH = −log₁₀[H⁺]
pOH = −log₁₀[OH⁻]
pKa = −log₁₀(Ka)

pH + pOH = 14 (water at 25 °C)
ExampleValuep-value
Lemon juice, [H⁺]5 × 10⁻³pH 2.3
Pure water, [H⁺]1 × 10⁻⁷pH 7
Blood, [H⁺]4 × 10⁻⁸pH 7.4
Acetic acid, Ka1.8 × 10⁻⁵pKa 4.74

Below pH 7 a solution is acidic and above 7 it is basic (alkaline). Because the scale is logarithmic, pH 3 is ten times more acidic than pH 4 and a hundred times more acidic than pH 5.

Worked Examples

A number greater than 1.

log₁₀(93) ≈ 1.968483
−log₁₀(93) ≈ −1.968483

Base 2.

log₂(16) = 4 because 2⁴ = 16
−log₂(16) = −4

pH from a concentration. A solution has [H+] = 2.5 × 10−5 mol/L:

pH = −log₁₀(2.5 × 10⁻⁵)
= 5 − log₁₀(2.5)
= 5 − 0.39794
≈ 4.60 (acidic)

Concentration from a pH. Undo the negative log by raising 10 to the negative pH: a pH of 2.3 means [H+] = 10−2.3 ≈ 0.005 mol/L.

Other Uses of Negative Logs

  • Absorbance: A = −log10(T), where T is the fraction of light transmitted. T = 10% gives A = 1 and T = 1% gives A = 2.
  • Information: an event with probability p carries −log2(p) bits. A coin flip is 1 bit and a die roll about 2.585 bits.
  • Machine learning: log loss (cross-entropy) adds up −ln(p) for the probability given to the right answer, so a confident wrong guess costs a lot.
  • Sound: an intensity 10−8 times a reference level is 10 × log10(10−8) = −80 dB, that is 80 dB below it.
  • Earthquakes and stars: magnitude scales are logarithmic too; the stellar magnitude scale even runs backwards, so brighter stars have smaller numbers.

Negative Log in Excel and Code

Tool−log of A1 or x
Excel, base 10=-LOG10(A1)
Excel, any base=-LOG(A1, 2)
Excel, base e=-LN(A1)
Python-math.log10(x), -math.log(x, b)
JavaScript-Math.log10(x)

Watch the base: in Excel, LOG(A1) is base 10, but in Python and JavaScript, log(x) is the natural log. Using ln by mistake for pH gives 9.21 instead of 4 for [H+] = 10−4.

Common Mistakes

  • Confusing −log(x) with log(−x). The first is a sign change; the second has no real value.
  • Dropping the minus sign. log10(10−4) = −4, but the pH is 4.
  • Using the wrong base. pH and all p-values use base 10, not ln.
  • Going back the wrong way. [H+] = 10−pH, not 10pH.
  • Treating pH as linear. pH 3 is ten times more acidic than pH 4, not slightly more.

Key Terms

Logarithm
The power a base must be raised to, to give a number.
Base
The number being raised to a power, such as 10, e or 2.
p-value
In chemistry, −log₁₀ of a quantity: pH, pOH, pKa.
[H⁺]
Hydrogen ion concentration in moles per litre.
Reciprocal
1 divided by a number; −log(x) = log(1/x).
Surprisal
−log(p), the information in an event of probability p.

How to Use the Negative Logarithm Calculator

  1. Enter the number. Type the positive number x, for example 0.0001. You can also type scientific notation such as 1e-7, 10^-7 or 2.5×10^-5, which is handy for concentrations.
  2. Choose the base. Type the base b, or press a chip: 10 for pH and other p-values, e for natural logs, or 2 for bits. Any positive base except 1 works.
  3. Read and copy the result. The negative logarithm −log_b(x) appears as you type, rounded to 6 decimal places, with the working underneath (for example −log₁₀(0.0001) = 4 · 10⁻⁴ = 0.0001). The table below it shows the ordinary logarithm, the sign rule and a check. Press Copy to copy the result, or Clear or Esc to start again.

Example: enter 2.5×10^-5 with base 10 and the result is 4.60206, with the note that this is pH 4.6, an acidic solution.

Who Can Use This Calculator?

Chemistry StudentspH, pOH, pKa and buffer problems
Lab WorkersAbsorbance from transmittance and quick p-value checks
Data ScientistsLog loss, surprisal and information in bits
Maths StudentsLogarithm rules, reciprocals and graph reflections

Frequently Asked Questions (FAQs)

What is a negative logarithm?

The negative logarithm of x is the logarithm with its sign flipped: −logb(x). It is the same as the logarithm of the reciprocal, logb(1/x). For example, log10(0.0001) = −4, so −log10(0.0001) = 4. It turns tiny numbers into small positive ones, which is why chemistry uses it for pH.

Is a negative logarithm the same as the logarithm of a negative number?

No. A negative logarithm, −log(x), takes the log of a positive number and changes the sign of the answer: −log10(100) = −2. The logarithm of a negative number, such as log(−100), has no real value at all, because a positive base raised to any power is always positive.

How do you calculate a negative log?

Work out the ordinary logarithm and change its sign. For −log10(93): log10(93) ≈ 1.968483, so −log10(93) ≈ −1.968483. With only a natural log key, use −logb(x) = −ln(x) ÷ ln(b).

When is a negative logarithm positive?

With a base greater than 1, −logb(x) is positive for x between 0 and 1, zero at x = 1, and negative for x greater than 1. So −log10(0.01) = 2, −log10(1) = 0 and −log10(100) = −2. A base between 0 and 1 reverses these signs.

How is pH calculated with a negative log?

pH is the negative base 10 logarithm of the hydrogen ion concentration in mol/L: pH = −log10[H+]. For [H+] = 1 × 10−4 mol/L, pH = −log10(10−4) = 4, an acidic solution. For 2.5 × 10−5 mol/L, pH ≈ 4.60.

How do you undo a negative logarithm?

Raise the base to the negative of the result: if y = −logb(x), then x = b−y. For pH this gives [H+] = 10−pH, so a pH of 2.3 means [H+] = 10−2.3 ≈ 0.005 mol/L.

What are pKa, pOH and other p-values?

A lowercase p in front of a quantity means “negative base 10 logarithm of”. pOH = −log10[OH−], and pKa = −log10(Ka) for an acid dissociation constant: acetic acid has Ka ≈ 1.8 × 10−5, so pKa ≈ 4.74. In water at 25 °C, pH + pOH = 14.

What is −log₂(p) in information theory?

It is the information content, or surprisal, of an event with probability p, measured in bits. A fair coin flip (p = 0.5) carries −log2(0.5) = 1 bit, a roll of a die (p = 1/6) about 2.585 bits, and drawing one particular card from a deck (p = 1/52) about 5.700 bits.

What is the negative log of 0 or of 1?

−log(1) = 0 in every base, because any base to the power 0 is 1. −log(0) is undefined: no power of the base equals 0, and −log(x) grows without limit as x gets closer to 0.

Is the Negative Logarithm Calculator free?

Yes. It is completely free, needs no sign-up, and can be used as many times as you like.

Try our Negative Logarithm Calculator to find −log(x) or a pH value instantly.