All Tools

Binary, Decimal & Hex Converter

Enter a number in binary, decimal, hexadecimal, or octal and see instant conversions to all four bases. Includes a bit-level layout, ASCII character lookup, and step-by-step conversion methods.

Input

Conversions

Decimal
255
Binary
0b11111111
Hexadecimal
0xFF
Octal
0o377

Bit Layout

7
1
6
1
5
1
4
1
3
1
2
1
1
1
0
1

Step-by-Step Conversion

1. Decimal to Binary (Division Method)

255÷2=127 remainder 1255 \div 2 = 127 \text{ remainder } 1127÷2=63 remainder 1127 \div 2 = 63 \text{ remainder } 163÷2=31 remainder 163 \div 2 = 31 \text{ remainder } 131÷2=15 remainder 131 \div 2 = 15 \text{ remainder } 115÷2=7 remainder 115 \div 2 = 7 \text{ remainder } 17÷2=3 remainder 17 \div 2 = 3 \text{ remainder } 13÷2=1 remainder 13 \div 2 = 1 \text{ remainder } 11÷2=0 remainder 11 \div 2 = 0 \text{ remainder } 1Read remainders bottom-up: 111111112\text{Read remainders bottom-up: } 11111111_2

2. Binary to Decimal (Positional Method)

111111112=1×27+1×26+1×25+1×24+1×23+1×22+1×21+1×2011111111_2 = 1 \times 2^{7} + 1 \times 2^{6} + 1 \times 2^{5} + 1 \times 2^{4} + 1 \times 2^{3} + 1 \times 2^{2} + 1 \times 2^{1} + 1 \times 2^{0}=128+64+32+16+8+4+2+1=255= 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

3. Decimal to Hexadecimal

25510=0xFF255_{10} = \text{0x}FF

Reference Guide

Binary (Base 2)

Binary uses only 0 and 1. Each position represents a power of 2. Computers store all data in binary.

10102=1×23+0×22+1×21+0×20=101010_2 = 1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 0 \times 2^0 = 10

Hexadecimal (Base 16)

Hex uses digits 0-9 and letters A-F. Each hex digit represents exactly 4 binary bits, making it a compact way to display binary data.

FF16=15×16+15=255\text{FF}_{16} = 15 \times 16 + 15 = 255

Division Method

To convert decimal to binary, repeatedly divide by 2 and record the remainders. Read the remainders from bottom to top to get the binary number.

ASCII Encoding

ASCII maps numbers 32-126 to printable characters. For example, 65 is the letter A, 97 is lowercase a, and 48 is the digit 0.