Number Base Converter

Type a number in any box and the others update: binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), or any base from 2 to 36. Works with whole numbers of any size.

255 in binary
11111111

Place values

How the binary digits add up to the decimal value.

DigitPlace valueWorth

0 to 16 in common bases

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

How positional bases work

In base 10 each place is worth ten times the one to its right: 255 = 2 × 100 + 5 × 10 + 5 × 1. In base 2 each place is worth twice the last, so 11111111 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Bases above 10 need extra digits: hexadecimal uses A to F for 10 to 15, and base 36 uses all ten digits and 26 letters.

Converting by hand

To convert from decimal, divide repeatedly by the target base and read the remainders from the last to the first. 255 ÷ 16 = 15 remainder 15, and 15 ÷ 16 = 0 remainder 15, so 255 is FF in hex. To convert to decimal, multiply each digit by its place value and add.

Binary and hex convert directly in groups: each hex digit is exactly four binary digits (F = 1111, A = 1010), and each octal digit three. That is why programmers write bytes as two hex digits.

Where you see them

Hexadecimal appears in web colors (#FF8800), MAC addresses, memory addresses and Unicode code points. Octal survives in Unix file permissions (chmod 755). Binary underlies all digital data; a byte is eight bits, 0 to 255. Base 36 is used for compact IDs such as short links.