   SEARCH HOME Math Central Quandaries & Queries  Question from Johanna, a student: Is there an easy way to convert from base to base. For example, base 5 to base 9 or base 2 to base 4 etc... if there is please send it to me asap Thank you Johanna We have two responses for you

Johanna,

If you go to our quandaries and queries section and type in the word base in the search box you will find a number of previously answered questions on bases that should help you. You may have to go from base 5 to base 10 and then to base 9 however.

Penny

Well Johanna, there are quick ways for some conversions, but not for others.

Because I (like you I presume) work and think in base ten most of the time, I would first convert to base 10, then to the target base. For example, convert 40242 in base 5 to base 9.

When we use different bases, we usually write a subscript after the number to indicate it isn't a base 10 number. e.g. 40242 in base 5 is written 402425.

(a) convert to base 10 by repeatedly multiplying digits and sums by fives:
401425 = (((4 * 5 + 0) * 5 + 2) * 5 + 4) * 5 + 2
= ((20*5 + 2) * 5 + 4) * 5 + 2
= (102 * 5 + 4) * 5 + 2
= 514 * 5 + 2
= 257210.

(b) convert to base 9 by repeatedly dividing by 9 and recording the remainders:
2572 / 9 = 285 remainder 7
285 / 9 = 31 remainder 6
31 / 9 = 3 remainder 4
3 is less than 9 so stop.
(read the last quotient (3) and all remainders backwards): 34679.

So 402425 = 257210 = 34679.

There are faster ways for particular combinations of bases. For example, 4E20 in hexadecimal (base 16) is easily converted to base 2: 0100 1110 0010 0000. Because 16 is just 24, so each base 16 number turns into a four digit (with leading zeros) base 2 number. But this kind of trick doesn't work for just any two bases.

Stephen La Rocque.     Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences.