Number base converter

Decimal 255 is 11111111 in binary, 377 in octal and FF in hexadecimal. Enter a number and its base to see it in the other bases, with the place values and repeated division shown.

Enter the details (current step)

Whole numbers only, with an optional minus sign. The prefixes 0x, 0b and 0o and spaces between digits may be used.

Base of the number
Show repeated division into

Result

Please complete the details. The result will appear here.

How it is calculated

  1. To convert to decimal, multiply each digit by the base raised to the power of its place and add the results: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11.
  2. To convert decimal to another base, divide by the base repeatedly and note each remainder until the quotient is 0. The remainders read from bottom to top give the answer.
  3. Digits above 9 are written as letters: A = 10, B = 11 and so on to F = 15 in hexadecimal, and up to Z = 35 in base 36. Capital or small letters may be used.
  4. Binary and hexadecimal results are grouped in fours, and octal and decimal results in threes, for easier checking. Copied results have no spaces.
  5. Whole numbers are converted exactly, however many digits they have. Fractions are not converted.
  6. All calculations are done in your browser. The details you enter are not sent to any server.

0 to 15 in each base

DecimalBinaryOctalHexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Worked examples

Decimal 255 to binary

Details
Decimal 255
Result
Binary 1111 1111

Decimal 255 to hexadecimal

Details
Decimal 255
Result
Hexadecimal FF

Binary 1011 to decimal

Details
Binary 1011
Result
Decimal 11

Hexadecimal 7E9 to decimal

Details
Hexadecimal 7E9
Result
Decimal 2 025

Octal 777 to binary

Details
Octal 777
Result
Binary 1 1111 1111

Hexadecimal 0xFFFF to octal

Details
Hexadecimal 0xFFFF
Result
Octal 177 777

Binary number of sixty-four 1s to decimal

Details
Binary 111111111111111111111111…
Result
Decimal 18 446 744 073 709 551 615

Z in base 36 to decimal

Details
Base 36 Z
Result
Decimal 35