Choose what you want to find from the menu, enter the base a and the exponent k, and press "Calculate". The answer is shown two ways, by hand with a given approximation (such as log₁₀ 2 ≈ 0.3010) and exactly from the full value.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter the base \(a\) and the exponent \(k\), and find on the spot how many digits a huge power \(a^k\) such as \(2^{100}\) has
- You get two answers: one by hand with a given approximation such as \(\log_{10} 2 \approx 0.3010\) (the method in Algebra 2 and precalculus textbooks), and the exact number of digits from calculating the whole value. The steps follow the same order as a written solution
- Another mode finds the leading digit (the leftmost digit) from the fractional part of the common logarithm
- For a power of a decimal less than 1, such as \(0.5^{100}\), it finds the decimal place where the first nonzero digit appears
- A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
RSA encryption, which protects communication on the internet, uses keys described as "2048-bit". A 2048-bit number is about \(2^{2048}\) in size, and from \(2048 \times \log_{10} 2 \approx 616.5\) it has 617 decimal digits.
The conversion "number of bits × 0.3010 ≈ number of decimal digits" is exactly the calculation on this page. This estimate shows how unrealistic it is to break such a key by trying every possibility.
Some bacteria divide about once every 20 minutes under good conditions. If that pace lasted 24 hours, there would be 72 divisions, and 1 bacterium would become \(2^{72}\). From \(72 \times 0.3010 \approx 21.7\), that is a 22-digit number (about \(4.7 \times 10^{21}\)).
In reality, limits on food and space stop the growth at some point. Still, one multiplication with the common logarithm shows that bacteria left alone multiply by many powers of ten. That is why the rule is to refrigerate food quickly.
Each time you fold a sheet of paper 0.004 inch (about 0.1 mm) thick, its thickness doubles. If you could fold it 42 times, it would be \(0.004 \times 2^{42}\) inches \(\approx\) 278,000 miles thick, farther than the Moon (about 239,000 miles away).
In reality, paper can only be folded about 7 or 8 times, so this is a thought experiment. Even so, how fast the digits grow when you keep doubling can be predicted exactly by the simple formula \(k \times \log_{10} 2\), and you can check your intuition with numbers.
In naturally collected money data, the leading digit is 1 about 30.1% of the time (equal to \(\log_{10} 2\)), 2 about 17.6% of the time, and so on. This lopsided pattern is known as Benford's law.
Made-up numbers tend to break this pattern, so auditors and fraud investigators use it as a check. The idea on this page, "the leading digit is decided by the fractional part of the common logarithm", is the basis of the law.
Science writes numbers that are too large or too small as powers of 10 (scientific notation), such as the distance to the Sun, about 1.496×10⁸ km, or the size of a hydrogen atom, about 1×10⁻¹⁰ m.
The exponent of 10 is exactly the integer part of the common logarithm, a direct sense of the number of digits. Astronomy and chemistry (Avogadro's number is about 6×10²³) are great places to practice thinking in powers of ten.
Formulas and figures
Symbols and terms
Symbols
| \(\log_{10} N\) | log base 10 of N | The common logarithm of \(N\) (the logarithm with base 10). It tells "10 to what power gives \(N\)". log is short for logarithm. |
| \(N\) | N | The number you are checking, for example for its number of digits. It is the first letter of "number". On this page it is the power \(a^k\). |
| \(a\) | a | The base (the number being multiplied). By convention, letters from the start of the alphabet are used for fixed numbers. |
| \(k\) | k | The exponent (how many times to multiply). In \(2^{100}\), it is 100. |
| \(n\) | n (lowercase) | The number of digits. It is the first letter of "number" and is often used for counts. |
| \(10^n\) | 10 to the nth power | 10 multiplied \(n\) times: 1 followed by \(n\) zeros (\(10^3 = 1000\)). It is the smallest \((n+1)\)-digit number. |
| \(f\) | f | The fractional part of the common logarithm, from the first letter of "fractional". The leading digit depends only on this \(f\). |
| \(d\) | d | The leading digit (the leftmost digit), from the first letter of "digit". |
| \(m\) | m | The decimal place where the first nonzero digit appears. It shows "how small" a number less than 1 is. |
| \(\lfloor x \rfloor\) | floor of x | The floor function: the greatest integer not greater than \(x\) (the integer part). Be careful with negative numbers: \(\lfloor -30.10 \rfloor = -31\). |
Terms
| common logarithm (common log) | The logarithm with base 10, \(\log_{10} x\). It tells "10 to what power gives \(x\)" and is tied directly to the number of digits in base 10. It is taught in Algebra 2. |
| logarithm | The number that tells what power of the base gives the argument. It is exactly the reverse of a power. |
| argument | The number inside a logarithm, the \(N\) in \(\log_{10} N\). Only numbers greater than 0 can be used. |
| base | The number \(a\) that a power \(a^k\) or a logarithm \(\log_{a} x\) is built on. On this page it is the "Base a" field. The common logarithm has base 10. |
| number of digits | How many digits appear when you write a whole number. 1024 has 4 digits. In math terms, "a whole number that is at least \(10^{n-1}\) and less than \(10^n\) has \(n\) digits". |
| leading digit | The leftmost digit of a number. The leading digit of 1024 is 1. It can be found from the fractional part of the common logarithm. |
| power | Multiplying the same number by itself several times. As in \(2^{3} = 2 \times 2 \times 2\), the small exponent at the upper right tells how many times. |
| exponent | The small number at the upper right of a power that tells what power to raise to. In \(2^{100}\), the exponent is 100. |
| integer part (characteristic) | When you split a number into "the greatest integer not greater than it" (the floor) and "the rest", this is the integer. For 30.10 it is 30. Note that for \(-30.10\) it is \(-31\), because the fractional part is always taken to be at least 0 and less than 1. For a common logarithm, it is also called the characteristic. |
| fractional part (mantissa) | When you split a number into "the greatest integer not greater than it" and "the rest", this is the rest. For 30.10 it is 0.10. The fractional part is always at least 0 and less than 1, so for \(-30.10\) it is \(0.90\). For a common logarithm, it is also called the mantissa. |
| approximation | A rounded value close to the true value that is easier to work with, such as using 0.3010 for \(\log_{10} 2 = 0.30102\ldots\). Rounding leaves an error, and multiplication makes the error larger. |
| significant figures | The digits of a measurement or approximation that can be trusted. 0.3010 is accurate only to 4 decimal places, so the fine detail of 10000 times it cannot be trusted. This explains why the answer by hand can differ from the exact answer on this page. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to these topics is the fastest way forward.
| Powers and exponents (Grades 5–6) |
|
| Extending exponents (Grade 8 and Algebra 2) |
|
| Definition of a logarithm (Algebra 2) |
|
| Log rules (Algebra 2) |
|
| Reading and writing inequalities (Grades 6–7 and Algebra 1) |
|
| Place value and digits (Grade 4 and up) |
|
How to calculate it in Excel
| Base a | 2 |
| Exponent k | 100 |
| Common log k×log10(a) | =B2*LOG10(B1) |
| Number of digits (integer part + 1) | =INT(B3)+1 |
| Base a | 2 |
| Exponent k | 100 |
| Common log k×log10(a) | =B2*LOG10(B1) |
| Fractional part of the common log | =B3-INT(B3) |
| Leading digit | =INT(10^B4) |
| Base a (a decimal less than 1) | 0.5 |
| Exponent k | 100 |
| Common log k×log10(a) | =B2*LOG10(B1) |
| Decimal place of the first nonzero digit | =-INT(B3) |
LOG10 is the common logarithm, and INT gives the greatest integer not greater than the number (the integer part, or floor). INT rounds down even for negative numbers (INT(-30.1) is -31), so "=-INT(B3)" in the third table gives the decimal place directly.
With the example numbers, the first table shows 31 (digits), the second shows 1 (the leading digit), and the third shows 31 (the 31st decimal place).
Excel calculates with about 15 digits of precision, so when the exponent is very large the answer can be off by 1 near a power of 10.
How to calculate it in Google Sheets
| Base a | 2 |
| Exponent k | 100 |
| Common log k×log10(a) | =B2*LOG10(B1) |
| Number of digits (integer part + 1) | =INT(B3)+1 |
| Base a | 2 |
| Exponent k | 100 |
| Common log k×log10(a) | =B2*LOG10(B1) |
| Fractional part of the common log | =B3-INT(B3) |
| Leading digit | =INT(10^B4) |
| Base a (a decimal less than 1) | 0.5 |
| Exponent k | 100 |
| Common log k×log10(a) | =B2*LOG10(B1) |
| Decimal place of the first nonzero digit | =-INT(B3) |
Copy the whole table, paste it into cell A1, and replace the base and exponent with your own numbers.
How to calculate it in Python
import math
a = 2 # base (a whole number 2 or more)
k = 100 # exponent (the power)
# Using the common logarithm (the same idea as the method by hand)
log_value = k * math.log10(a)
digit_count = math.floor(log_value) + 1 # integer part + 1 = number of digits
fractional = log_value - math.floor(log_value)
leading_digit = math.floor(10 ** fractional) # leading digit from the fractional part
print(f"Common log: {log_value}")
print(f"Number of digits: {digit_count}, leading digit: {leading_digit}")
# Exact calculation (Python integers have no digit limit, so we can check by calculating the whole value)
actual = a ** k
print(f"Actual number of digits: {len(str(actual))}, actual leading digit: {str(actual)[0]}")
# For a decimal less than 1 (which decimal place for 0.5 to the 100th power), the common log is negative
position = -math.floor(100 * math.log10(0.5))
print(f"The first nonzero digit of 0.5 to the 100th power appears at decimal place {position}")
How to write it in LaTeX and other math languages (copy and paste)
log₁₀(aᵏ) = k log₁₀ a
\log_{10} a^{k} = k \log_{10} a
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>log</mi><mn>10</mn></msub>
<msup><mi>a</mi><mi>k</mi></msup>
<mo>=</mo>
<mi>k</mi>
<msub><mi>log</mi><mn>10</mn></msub>
<mi>a</mi>
</mrow>
</math>
log_10 (a^k) = k log_10 a
Log10[a^k] == k*Log10[a]
log10(a^k) = k*log10(a);
log10(a^k) == k*log10(a)
log_10(a^k) = k log_10(a)
10ⁿ⁻¹ ≤ N < 10ⁿ
10^{n-1} \le N < 10^{n}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msup><mn>10</mn><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msup>
<mo>≤</mo>
<mi>N</mi>
<mo><</mo>
<msup><mn>10</mn><mi>n</mi></msup>
</mrow>
</math>
10^(n-1) <= N < 10^n
IntegerLength[a^k]
length(a^k);
floor(log10(a^k)) + 1
10^(n-1) ≤ N < 10^n
log₁₀ d ≤ f < log₁₀(d+1)
\log_{10} d \le f < \log_{10} (d+1)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>log</mi><mn>10</mn></msub>
<mi>d</mi>
<mo>≤</mo>
<mi>f</mi>
<mo><</mo>
<msub><mi>log</mi><mn>10</mn></msub>
<mo>(</mo><mi>d</mi><mo>+</mo><mn>1</mn><mo>)</mo>
</mrow>
</math>
log_10 d <= f < log_10 (d+1)
First[IntegerDigits[a^k]]
trunc(10^frac(k*log10(a)));
floor(10^(mod(k*log10(a), 1)))
log_10(d) ≤ f < log_10(d+1)
10⁻ᵐ ≤ N < 10⁻ᵐ⁺¹
10^{-m} \le N < 10^{-m+1}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msup><mn>10</mn><mrow><mo>−</mo><mi>m</mi></mrow></msup>
<mo>≤</mo>
<mi>N</mi>
<mo><</mo>
<msup><mn>10</mn><mrow><mo>−</mo><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msup>
</mrow>
</math>
10^(-m) <= N < 10^(-m+1)
-Floor[Log10[a^k]]
-floor(log10(a^k));
-floor(log10(a^k))
10^(-m) ≤ N < 10^(-m+1)
How to have ChatGPT do the calculation
You are a calculation assistant for common logarithms and the number of digits. Do the following calculations by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). 1. How many digits does 2 to the 100th power have? Find it both by adding 1 to the integer part of k × log10(a) and by counting directly with len(str(2**100)), and check that they agree. 2. Find the leading digit (the leftmost digit) of 2 to the 100th power from the fractional part of the common logarithm, and compare it with the actual value. 3. At which decimal place does the first nonzero digit of 0.5 to the 100th power appear? Find it with -floor(100 × log10(0.5)). Show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
