What is log₂ used for?
Bits, binary trees, algorithm complexity, and MIDI/octave math among other uses.
Compute log₂(x)—common in computer science, information theory, and binary scales.
Provide x > 0 to evaluate log₂(x).
How to use Log Base 2 Calculator, plus the formulas and logic behind the results.
log₂(x) answers “2 to what power equals x?” It equals ln(x)/ln(2).
log₂(x) = ln(x) / ln(2)2^{log₂(x)} = x for x > 0Powers of two
Rejects non-positive x, then computes log(x)/log(2) and formats the result.
Only positive real arguments are supported.
Common questions about this calculator and how to use the results.
Bits, binary trees, algorithm complexity, and MIDI/octave math among other uses.
Yes, as long as it is positive (e.g. log₂(0.5) = −1).
No. Logarithms are undefined at zero.
Usually via change of base: ln(x)/ln(2).
You still get a real (often non-integer) result.
In some CS texts lg means log₂; elsewhere lg may mean log₁₀.