Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know a similar question was asked before, but I wanted to know if this can be extended to any number system by a generic formula.

For example, given a number X in number system A, how many digits would it have in number system B? I'm looking for a sort of universal formula in terms of X, A and B.


share|cite|improve this question
up vote 1 down vote accepted

As J. M. said in a comment to the question you ask, an integer $X$ has $\lfloor 1+\log_B X\rfloor$ base-$B$ digits. Going from base $A$ to base $B$ the number of digits is multiplied by $\frac{\log A}{\log B}$ but that is approximate due to the 1 and the floor function.

share|cite|improve this answer
I apologize if this seems trivial but I'm unable to use it in an example. Let's say I have a decimal number of 100 digits and I want to find how many bits it would have. Would that be (approximately) 100 * log(2)/(log 10)? – David Feb 23 '11 at 15:00
I had a typo, now fixed. It should be 100*log(10)/log(2). You can check with smaller numbers. A three digit number ranges from 100 to 999. In base 2 this ranges from 7 to 10 bits. And log (10)/log(2) is about 1/.30103=3.32 – Ross Millikan Feb 23 '11 at 15:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.