Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Logarithm Calculator

?How to use Logarithm Calculator+
  • Choose between standard bases (2, e, 10) or a custom base
  • For custom base, enter any positive number except 1
  • Enter the number for which you want to find the logarithm
  • Click Calculate to compute the result
  • Hover over ? icons for additional help

log
?
=
?

A logarithm calculates what exponent is needed for a base to reach a given number. If $b^x = N$, then $\log_b(N) = x$. For example, $\log_2(8) = 3$ because $2^3 = 8$. The most common bases are: base $2$ (binary logarithm), base $e$ (natural logarithm), and base $10$ (common logarithm).







Getting Started with the Calculator

The logarithm calculator has two main options at the top: Standard and Custom base. Standard gives you quick access to the three most common logarithm bases: 22, ee (approximately 2.7182.718), and 1010. Custom lets you enter any positive number as your base (except 11).

Start by choosing your base type using the radio buttons. If you select Standard, a dropdown menu appears with bases 22, ee, and 1010. For Custom, you get an empty box where you can type any base you want—try 33, 55, or 77.

Enter the number you want to find the logarithm of in the main input box at the top. This must be a positive number. You can use whole numbers like 88 or 100100, or decimals like 2.52.5 or 50.7550.75. The calculator accepts any positive value.

Click the blue Calculate button to see your result appear on the right side of the equals sign. The answer shows up to four decimal places for precision. Use Reset to clear everything and start a new calculation.

Choosing Between Standard and Custom Base

The Standard option is perfect for everyday calculations. Select it when you need logarithms with base 22 (used in computer science), base ee (natural logarithm, used in calculus and science), or base 1010 (common logarithm, used in many applications). Just pick your base from the dropdown and you're ready.

With Standard selected, the dropdown shows three choices. Base 22 is the binary logarithm, written as log2\log_2. Base ee (approximately 2.71832.7183) is the natural logarithm, often written as ln\ln. Base 1010 is the common logarithm, sometimes written as just log\log without a subscript.

Switch to Custom when you need a different base. This opens a text input where you can type any positive number except 11. Try base 33 for ternary logarithms, base 55 for quinary, or any other positive number. Custom bases are useful for specialized calculations and learning.

You can switch between Standard and Custom anytime by clicking the radio buttons. The calculator remembers your number, so you can easily compare log2(8)\log_2(8) versus log3(8)\log_3(8) by switching modes and recalculating.

Entering Your Number

Click in the top input box labeled "Enter number" to type your value. This is the number you want to find the logarithm of—mathematically, if you're calculating logb(N)\log_b(N), this box holds NN. Only positive numbers work because logarithms of zero or negative numbers don't exist in regular mathematics.

You can enter whole numbers like 88, 1616, 100100, or 10001000. Try 88 with base 22 to get 33 (because 23=82^3 = 8). Decimals work too: enter 2.52.5, 10.710.7, or 99.9999.99. The calculator uses high-precision math to handle decimal inputs accurately.

Very large numbers are fine: try 10000001000000 with base 1010 to get 66. Very small decimals work too: 0.50.5 with base 22 gives 1-1 (because 21=0.52^{-1} = 0.5). The number can have many decimal places—the calculator maintains precision throughout.

The question mark (?) icon shows a tooltip when you hover over it: "Enter the value to calculate the logarithm of." If you enter something invalid, the input box turns red and an error message appears below. Fix your entry to continue.

Using Standard Bases

With Standard selected, click the dropdown menu to choose your base. Base 2 calculates binary logarithms, answering "what power of 22 gives this number?" For example, log2(16)=4\log_2(16) = 4 because 24=162^4 = 16. Base 22 is common in computer science for measuring information and algorithm complexity.

Base e computes natural logarithms, written as ln\ln in many textbooks. The number e2.71828e \approx 2.71828 appears throughout calculus, physics, and biology. Try ln(7.389)2\ln(7.389) \approx 2 because e27.389e^2 \approx 7.389. Natural logarithms describe growth, decay, and many natural phenomena.

Base 10 gives common logarithms, often written as just log\log without a subscript. This base relates to our decimal number system. Calculate log10(100)=2\log_{10}(100) = 2 because 102=10010^2 = 100, or log10(1000)=3\log_{10}(1000) = 3 because 103=100010^3 = 1000. Base 1010 appears in scientific notation, pH calculations, and decibel measurements.

Switch between bases by clicking the dropdown. The calculator preserves your number, making it easy to compare results. Try log2(8)=3\log_2(8) = 3, ln(8)2.0794\ln(8) \approx 2.0794, and log10(8)0.9031\log_{10}(8) \approx 0.9031 to see how the same number has different logarithms depending on the base.

Working with Custom Base

Select the Custom radio button to unlock the base input field. Click in the box and type any positive number except 11. The base must be greater than 00 and cannot equal 11 because logarithms with base 11 are undefined (every number would give infinity as the answer).

Try base 33: calculate log3(9)=2\log_3(9) = 2 because 32=93^2 = 9. Or base 55: find log5(125)=3\log_5(125) = 3 because 53=1255^3 = 125. Custom bases work just like standard ones—they answer "what exponent gives this result?" but for your chosen base.

Decimal bases work too. Enter 2.52.5 as a base and calculate log2.5(6.25)=2\log_{2.5}(6.25) = 2 because 2.52=6.252.5^2 = 6.25. Large bases are fine: try base 100100 to see log100(10000)=2\log_{100}(10000) = 2 because 1002=10000100^2 = 10000.

If you enter an invalid base like 00, 3-3, or 11, the calculator displays an error: "Both value and base must be positive numbers." The base input box turns red until you correct it. Enter a valid positive number (not 11) to continue.

Understanding Your Results and Errors

After clicking Calculate, your answer appears on the right side of the equals sign. The result displays up to four decimal places. For clean answers like log2(8)=3\log_2(8) = 3, you'll see 3.00003.0000. For irrational results like log2(5)2.3219\log_2(5) \approx 2.3219, you get precise decimals.

Negative results are normal. When your number is less than 11, logarithms give negative answers. Try log2(0.5)=1.0000\log_2(0.5) = -1.0000 because 21=0.52^{-1} = 0.5. Or log10(0.01)=2.0000\log_{10}(0.01) = -2.0000 because 102=0.0110^{-2} = 0.01. This isn't an error—it's correct mathematics.

Zero and fractional results appear for various inputs. Calculate log10(1)\log_{10}(1) with any base and get 00 (because any number to the power 00 equals 11). Try log2(3)1.5850\log_2(3) \approx 1.5850 for a decimal between whole numbers.

Error messages appear in red when something's wrong. "Both value and base must be positive numbers" means you entered zero, a negative, or invalid text. "Input contains invalid characters" appears if you type letters or symbols. Fix the red input box to continue. The calculator won't compute until all inputs are valid positive numbers.

What Are Logarithms

A logarithm answers the question: "What exponent do I need?" If you know 2?=82^? = 8, the logarithm tells you the answer is 33. We write this as log2(8)=3\log_2(8) = 3. Logarithms are the opposite (inverse) of exponents—they undo what exponents do.

Think of it like division versus multiplication. If 3×4=123 \times 4 = 12, then 12÷3=412 \div 3 = 4 reverses the operation. Similarly, if 23=82^3 = 8, then log2(8)=3\log_2(8) = 3 reverses it. The logarithm "undoes" the exponent to reveal what power was used.

The general form is logb(N)=x\log_b(N) = x, which means bx=Nb^x = N. The base (bb) is the number being raised to a power, the argument (NN) is the result you're trying to reach, and the logarithm (xx) is the exponent needed. So log5(25)=2\log_5(25) = 2 because 52=255^2 = 25.

Logarithms only work with positive numbers. You cannot find log(0)\log(0) or log(5)\log(-5) because no real exponent makes a positive base equal zero or negative. Also, base 11 doesn't work because 11 raised to any power always equals 11.

Understanding Different Bases

The base determines which number is being raised to a power. Base 22 means powers of 22: 21=22^1 = 2, 22=42^2 = 4, 23=82^3 = 8. So log2(4)=2\log_2(4) = 2 because 44 is the second power of 22. Different bases give different answers for the same number.

Base 2 (binary logarithm) is fundamental in computer science. Computers use binary (base 22), so log2\log_2 measures things like how many times you can divide by 22, or how many bits are needed. Eight items need log2(8)=3\log_2(8) = 3 bits to represent.

Base e (natural logarithm) uses e2.71828e \approx 2.71828, a special mathematical constant. Natural logarithms appear in growth and decay: population growth, radioactive decay, compound interest. The notation ln(x)\ln(x) means loge(x)\log_e(x). For example, ln(20)2.996\ln(20) \approx 2.996.

Base 10 (common logarithm) matches our decimal system. It tells you how many digits a number has (roughly). Since 102=10010^2 = 100 and 103=100010^3 = 1000, numbers between 100100 and 10001000 have logarithms between 22 and 33. This helps with scientific notation and measuring scales like pH or decibels.

Simple Logarithm Rules

The logarithm of 1 always equals 0, regardless of base: log2(1)=0\log_2(1) = 0, log10(1)=0\log_{10}(1) = 0, log5(1)=0\log_5(1) = 0. This is because any number to the power 00 equals 11: 20=12^0 = 1, 100=110^0 = 1, 50=15^0 = 1.

The logarithm of the base equals 1: log2(2)=1\log_2(2) = 1, log10(10)=1\log_{10}(10) = 1, log7(7)=1\log_7(7) = 1. This makes sense because the base to the first power equals itself: 21=22^1 = 2, 101=1010^1 = 10, 71=77^1 = 7.

Multiplication becomes addition with logarithms: logb(xy)=logb(x)+logb(y)\log_b(xy) = \log_b(x) + \log_b(y). For example, log2(8)+log2(4)=3+2=5=log2(32)\log_2(8) + \log_2(4) = 3 + 2 = 5 = \log_2(32) because 8×4=328 \times 4 = 32. This property makes logarithms useful for simplifying multiplication.

Division becomes subtraction: logb(xy)=logb(x)logb(y)\log_b(\frac{x}{y}) = \log_b(x) - \log_b(y). Try log2(8)log2(4)=32=1=log2(2)\log_2(8) - \log_2(4) = 3 - 2 = 1 = \log_2(2) because 8÷4=28 \div 4 = 2. And exponents become multiplication: logb(xn)=nlogb(x)\log_b(x^n) = n \cdot \log_b(x). So log2(82)=2log2(8)=2×3=6\log_2(8^2) = 2 \cdot \log_2(8) = 2 \times 3 = 6.

Practice Problems to Try

Easy problems with base 2: Calculate log2(4)\log_2(4), log2(16)\log_2(16), and log2(32)\log_2(32). Answers: 22 (because 22=42^2 = 4), 44 (because 24=162^4 = 16), and 55 (because 25=322^5 = 32). These are all whole numbers because the inputs are perfect powers of 22.

Base 10 problems: Find log10(100)\log_{10}(100), log10(1000)\log_{10}(1000), and log10(10000)\log_{10}(10000). Answers: 22, 33, and 44. Notice the pattern—each answer tells you how many zeros are in the number (plus one for the leading 11).

Problems with decimals: Try log2(5)\log_2(5), log10(50)\log_{10}(50), and log3(10)\log_3(10). Answers: approximately 2.32192.3219, 1.69901.6990, and 2.09592.0959. These give decimals because the inputs aren't perfect powers of their bases.

Negative logarithms: Calculate log2(0.5)\log_2(0.5), log10(0.1)\log_{10}(0.1), and log5(0.2)\log_5(0.2). Answers: 1-1, 1-1, and 1-1. All equal 1-1 because 21=0.52^{-1} = 0.5, 101=0.110^{-1} = 0.1, and 51=0.25^{-1} = 0.2.

Custom base challenges: Find log3(27)\log_3(27), log5(125)\log_5(125), and log7(49)\log_7(49). Answers: 33, 33, and 22. Check: 33=273^3 = 27, 53=1255^3 = 125, and 72=497^2 = 49.

Real-World Uses of Logarithms

pH Scale uses base 1010 logarithms to measure acidity. A pH of 77 is neutral, below 77 is acidic, above 77 is basic. The formula involves log10\log_{10} of hydrogen ion concentration. Each whole number change represents a tenfold difference—pH 55 is ten times more acidic than pH 66.

Decibels measure sound intensity using log10\log_{10}. The formula is 10log10(II0)10 \cdot \log_{10}(\frac{I}{I_0}) where II is intensity. A whisper is about 3030 dB, normal conversation 6060 dB, a rock concert 120120 dB. Every 1010 dB increase means the sound is ten times more intense.

Earthquake magnitude (Richter scale) uses logarithms. A magnitude 55 earthquake releases about 3232 times more energy than magnitude 44 because the scale is logarithmic. log10\log_{10} helps compress the huge range of earthquake energies into manageable numbers.

Population growth and compound interest use natural logarithms (base ee). If bacteria double every hour, ln\ln helps calculate how long to reach a certain population. The formula t=ln(N/N0)ln(2)t = \frac{\ln(N/N_0)}{\ln(2)} tells you how many doublings occurred.

Computer algorithms use log2\log_2 to analyze efficiency. Binary search has complexity O(log2n)O(\log_2 n)—it divides the problem in half each step. Searching 10241024 items takes only about log2(1024)=10\log_2(1024) = 10 steps instead of checking all 10241024.

Related Calculators and Tools

Exponent Calculator performs the opposite operation. Instead of finding what exponent gives a result, you calculate the result from a known base and exponent. Use it to verify logarithms: if log2(8)=3\log_2(8) = 3, check that 23=82^3 = 8 using the exponent calculator.

Root Calculator finds roots, which are fractional exponents. The square root of 1616 equals 160.516^{0.5}, and you can verify this using logarithms: 0.5log(16)=log(4)0.5 \cdot \log(16) = \log(4). Roots and logarithms are related through exponent rules.

Scientific Calculator combines logarithms with other operations for complex formulas. Use it when logarithms are part of longer calculations involving multiple steps, parentheses, or different operations.

Logarithmic Tables provide pre-calculated values for common logarithms. Before calculators existed, people looked up logarithms in books. Our tables page shows logarithms for reference and helps you understand patterns in logarithmic values.

For deeper learning, explore exponential growth and decay, logarithmic scales in science, change of base formula, and how logarithms simplify multiplication and division in complex calculations.