Math Fundamentals18 sections · 814 units
Open in Course

Change of Base Formula (Converting bases)

Switch between any bases

You can convert a logarithm from one base to another using the change of base formula: logb(x)=logk(x)logk(b)\log_b(x) = \frac{\log_k(x)}{\log_k(b)} for any base k>0k > 0.

For example, to compute log2(100)\log_2(100) using base 1010: log2(100)=log10(100)log10(2)=20.3016.64\log_2(100) = \frac{\log_{10}(100)}{\log_{10}(2)} = \frac{2}{0.301} \approx 6.64.

This formula shows why different bases only differ by a constant factor. The ratio 1logk(b)\frac{1}{\log_k(b)} is constant, so O(log2n)=O(log10n)O(\log_2 n) = O(\log_{10} n) in Big-O notation.