Apex Conversion

Number Base Converter

Decimal, binary, hexadecimal, and octal in one place — pick the base you have, type the value, and read off the other three. Built for homework checks and debugging sessions alike.

Decimal

255

Binary

0b1111 1111

Hexadecimal

0xFF

Octal

0o377

Handles arbitrarily large whole numbers. Binary groups in 4-bit nibbles — each nibble maps to exactly one hex digit, which is why programmers write FF instead of 11111111.

How Base Conversion Works

Every base is positional — each digit's place multiplies by another power of the base. Binary maps directly onto hex because 2⁴ = 16: every group of four bits is exactly one hex digit, which is why memory addresses and colors are written in hex rather than 32-character binary strings.

Worked example: 255

Decimal  255  = 2×100 + 5×10 + 5×1
Binary   1111 1111  = 128+64+32+16+8+4+2+1
Hex      FF   = 15×16 + 15
Octal    377  = 3×64 + 7×8 + 7

Landmarks: 2⁸ = 256 (byte), 2¹⁰ = 1024,
#FFFFFF = 16,777,215 (24-bit white)

Frequently Asked Questions

What is 255 in binary and hexadecimal?

11111111 in binary and FF in hex — it's the largest value one byte (8 bits) can hold, which is why RGB color channels run 0–255 and why #FFFFFF is pure white. 256 rolls over to 1 0000 0000 binary, 100 hex.

Why do programmers use hexadecimal instead of binary?

Compactness with a perfect mapping: each hex digit is exactly four bits, so a 32-bit value is 8 hex characters instead of 32 ones and zeros, and you can convert between them digit-by-digit in your head. Memory addresses, color codes, and MAC addresses are all hex for this reason.

How do I convert decimal to binary by hand?

Divide by 2 repeatedly and read the remainders bottom-up: 13 → 6 r1 → 3 r0 → 1 r1 → 0 r1 gives 1101. Going the other way, add up the place values: 1101 = 8 + 4 + 0 + 1 = 13. The same division method works for any base — divide by 16 for hex.

What do the prefixes 0x, 0b, and 0o mean?

They mark the base in programming so 10 isn't ambiguous: 0x10 is hex (sixteen), 0b10 is binary (two), 0o10 is octal (eight), and plain 10 is decimal. Most languages — Python, JavaScript, C — accept these literally in code.

Related Tools