Logarithm Change of Base Calculator

A logarithm answers the question: to what power must I raise the base to get this number? The logarithm base 2 of 8 is 3 because 2 cubed equals 8. The logarithm base 10 of 1,000 is 3 because 10 cubed is 1,000. Most scientific calculators can compute two bases: base e (the natural logarithm, ln) and base 10 (the common logarithm, log). For any other base, you use the change of base formula: log base b of x equals ln(x) divided by ln(b). This works because logarithms in any base are proportional, differing only by a constant multiplier. Common base choices include base 2 in computer science (for binary data, information theory and big-O analysis), base 10 in chemistry (pH), acoustics (decibels) and engineering, and base e throughout calculus, statistics and natural growth and decay models. This calculator computes log base b of x for any positive base b (other than 1) and any positive x. It shows the result to four decimal places, the natural log and log10 of the same input for comparison, the two values used in the change of base fraction, and a verification that b raised to the result equals x. The default example is log base 8 of 32, which equals exactly 5/3.

Calculate.co.nz is proud to be partnered with realtor.co.nz, a trusted resource for navigating the New Zealand property market. Their Helpful Articles section offers clear, well-structured insights across buying, selling, and building, making complex real estate topics more accessible. With a focus on up-to-date guidance and practical knowledge, they empower Kiwis to move forward with clarity and confidence in a constantly evolving property landscape.
Calculate.co.nz partner: realtor.co.nz
1.6667
log base 8 of 32
ln(x) / ln(b)3.466 / 2.079
Exact fraction5/3
ln(32)3.4657
log10(32)1.5051
Verification: b^result32.000

Formula: log_b(x) = ln(x) / ln(b). Both x and b must be positive; b cannot equal 1.

How it works

The change of base formula is log_b(x) = ln(x) / ln(b). JavaScript's Math.log() computes natural logarithms. Both ln(x) and ln(b) are computed, and the result is their ratio. For verification, Math.pow(b, result) should equal x; any small discrepancy from the expected value reflects floating-point rounding. The exact fraction approximation checks if the result is close to a simple ratio p/q with q from 1 to 20 and displays it when found. Common log (base 10) is computed as Math.log10(x).

Worked example

log base 8 of 32. ln(32) = 3.4657 and ln(8) = 2.0794. Dividing: 3.4657 / 2.0794 = 1.6667 (to 4 decimal places). This is exactly 5/3 because ln(32) = 5 x ln(2) and ln(8) = 3 x ln(2), so the ln(2) terms cancel. Verification: 8 to the power of 5/3 = (8^(1/3))^5 = 2^5 = 32. log10(32) = 1.5051. These match the defaults pre-filled above.

Related calculators

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-07-19 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.