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

Revising for an exam - could someone explain to me how you can convert an ordinary numbers to octal, hexadecimal and binary

would be appreciated

share|cite|improve this question
There are good answers here; you might want o accept one. – ncmathsadist Jan 3 '14 at 20:43

Work on converting a decimal integer to binary. Then octal & hexadecimal follow just by grouping the digits in groups of 3 or 4 respectively.

To convert to binary, repeatedly divide by 2 and collect the remainders (which must all be either 0 or 1) until you reach zero. The binary representation is then given by the remainders, starting with the last first.

For example, take $23$. Dividing by $2$ repeatedly gives the sequence $11+1$, $5+1$, $2+1$, $1+0$, $0+1$. Reading the remainders in reverse gives $23_{10} = 1 0 1 1 1_2$.

share|cite|improve this answer

Fastest way is to divide by base repeatedly. Here is an example

Convert 1000-decimal to hex

$$ 1000 = 62 \times 16 + 8 \\ 62 = 3 \times 16 + 14 \\ 3 = 0 \times 16 + 3 $$ now write all the remainders in hex $3\rightarrow3$, $14\rightarrow E$, and $8 \rightarrow 8$ and read it bottom to top to get

1000-decimal = 3E8-hex

** Added as after thought**

If you use Windows, then bring up the calculator, and in the menu "view" select programmer. You can select the input mode (hex, decimal etc) and then once you have entered the value, you can change the base to see the value in different bases

share|cite|improve this answer
It's a calculator exam no sneaky tricks available on ordinary calc? – user118918 Jan 3 '14 at 17:38
most calculators can do repeated divisions. You just have to keep track of the fractions. I will add another example. – user44197 Jan 4 '14 at 1:41

The last digit of a number $n$ in base $b$ is the remainder of $n$ divided by $b$. The other digits are the digit of the integer quotient $n/b$.

Hence the algorithm: make the integer division $n/b$. Write the rest and repeat the algorithm with $n$ replace by the quotient. Write the rest as digits from right to left.

share|cite|improve this answer

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.