2ⁿ Power of Two Checker

Check whether a positive integer is an exact power of two and estimate its logarithm base 2.

No ratings yet — be the first

Enter details

Power of two
Is= 2^n ?

Log in or create a free account to save your inputs and results, so you don't have to enter them again next time.🔒 No spam, ever. We never sell or share your details, and you can delete your history or account at any time. Privacy policy

Fill in the details and click Calculate to see your results.

Formula at a glance

Power of 2 formula: k = floor(log2(n)); 2^k = n
How the power of 2 works: k = floor(log2(n))

Rate this calculator

Was it useful? A quick star rating helps others — and you can leave a comment too.
Rate it: ★ ★ ★ ★ ★

📘 About the Power of 2 Calculator

Powers of two — 1, 2, 4, 8, 16, 32 … 1024 — are everywhere in computing. A number is a power of two exactly when its binary form has a single 1.

🧮 Formula

Exponent estimate
k = floor(log2(n))
Exact power test
2^k = n

Where

  • n = positive integer
  • k = floor(ln(n)/ln(2))
  • n is an exact power of two when 2^k = n
Use positive integer inputs for the intended exact classification.

✏️ Worked examples

1024

You enter
Positive Integer1024
You get
Is 1024 a power of 2?Yes ✓ — 2¹⁰ = 1024
log₂ 102410
Nearest powers of 21024 (2¹⁰)
In binary10000000000

Yes ✓ — 2¹⁰ = 1024.

1000

You enter
Positive Integer1000
You get
Is 1000 a power of 2?No ✗
log₂ 10009.965784285
Nearest powers of 2512 (2⁹) and 1024 (2¹⁰)
In binary1111101000

No ✗; 512 (2⁹) and 1024 (2¹⁰).

🧭 How to use this calculator

What you enter

  • Positive Integer

What you get

  • Exact Power of 2
  • Integer Exponent
  • Nearest Lower Power of 2

💡 Examples

  • 1 = 2^0.
  • 8 = 2^3.
  • 64 = 2^6.
  • 100 is not a power of two.

❓ Frequently asked questions

Is 1024 a power of 2?

Yes, 2¹⁰ = 1024.