Quick reference for the most frequently used number base conversions.
How to Convert Binary to Hexadecimal
Binary (Base 2) → Hexadecimal (Base 16)
Group binary digits into sets of 4 from right to left, then map each group to its hex equivalent. For example, 1010 1111 becomes AF. To convert hex back to binary, expand each hex digit to its 4-bit binary equivalent.
10101111 → AF
Each hex digit represents exactly 4 binary bits — memorize the 0-F mapping and conversions become instant.
Try it above — enter your number and see the result instantly.
How to Convert Binary to Decimal
Binary (Base 2) → Decimal (Base 10)
Multiply each binary digit by 2 raised to the power of its position (starting from 0 on the right), then sum all values. For example, 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11. To convert decimal to binary, divide repeatedly by 2 and read remainders bottom-up.
1011 → 11
Powers of 2 are worth memorizing: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024.
Try it above — enter your number and see the result instantly.
How to Convert Hexadecimal to Decimal
Hexadecimal (Base 16) → Decimal (Base 10)
Multiply each hex digit by 16 raised to the power of its position, then sum. For example, FF = 15×16¹ + 15×16⁰ = 240 + 15 = 255. To convert decimal to hex, divide repeatedly by 16 and map remainders to hex digits.
FF → 255
Remember that A=10, B=11, C=12, D=13, E=14, F=15 in hexadecimal.
Try it above — enter your number and see the result instantly.
How to Convert Decimal to Octal
Decimal (Base 10) → Octal (Base 8)
Divide the decimal number repeatedly by 8, collecting remainders. Read the remainders from bottom to top to get the octal result. For example, 255 ÷ 8 = 31 R7, 31 ÷ 8 = 3 R7, 3 ÷ 8 = 0 R3, giving 377. To convert octal to decimal, multiply each digit by 8^position and sum.
255 → 377
Octal is commonly used for Unix file permissions: 7=rwx, 5=r-x, 4=r--.
Try it above — enter your number and see the result instantly.
How to Convert Octal to Hexadecimal
Octal (Base 8) → Hexadecimal (Base 16)
The easiest method is to convert octal to binary first (each octal digit = 3 bits), then regroup into 4-bit nibbles for hex. For example, octal 755 → binary 111 101 101 → regroup as 0001 1110 1101 → hex 1ED. To reverse, convert hex to binary then regroup into 3-bit octal groups.
755 → 1ED
Going through binary as an intermediate step is almost always the fastest path between octal and hex.
Try it above — enter your number and see the result instantly.
How to Convert Octal to Binary
Octal (Base 8) → Binary (Base 2)
Replace each octal digit with its 3-bit binary equivalent. For example, octal 17 → 001 111 → binary 1111 (drop leading zeros). To convert binary to octal, group bits into sets of 3 from the right and map each group to its octal digit.
17 → 1111
Since 8 = 2³, each octal digit maps to exactly 3 binary digits — making this conversion a simple lookup.
Try it above — enter your number and see the result instantly.
How to Convert Hex to Binary
Hexadecimal (Base 16) → Binary (Base 2)
Replace each hex digit with its 4-bit binary equivalent and concatenate. For example, hex AF → 1010 1111. Drop any leading zeros for the final binary value. To go back, group binary into nibbles from the right and map each group to its hex digit.
AF → 10101111
Memorize the 16-entry hex-to-nibble lookup table — it makes hex-to-binary conversion almost instant.
Try it above — enter your number and see the result instantly.
How to Convert Decimal to Hex
Decimal (Base 10) → Hexadecimal (Base 16)
Repeatedly divide the decimal number by 16, recording the remainder each step. The remainders read bottom-to-top form the hex value. Map remainders 10–15 to letters A–F. For example, 255 ÷ 16 = 15 remainder 15 → FF.
255 → FF
When the divisor is 16, remainders 10–15 become A–F. Keep a small mapping in your head: 10=A, 11=B, …, 15=F.
Try it above — enter your number and see the result instantly.
How to Convert Decimal to Hexadecimal
Decimal (Base 10) → Hexadecimal (Base 16)
The same procedure as decimal-to-hex, often spelled out fully when discussing CSS colors, MAC addresses, or memory addresses. Divide the decimal value by 16 repeatedly and read remainders in reverse, mapping 10–15 to A–F. The result is the hexadecimal representation of the original number.
6719 → 1A3F
For CSS color values, splitting into red/green/blue channels first (each 0–255) keeps each conversion small and obvious.
Try it above — enter your number and see the result instantly.
How to Convert Hex to Decimal
Hexadecimal (Base 16) → Decimal (Base 10)
Multiply each hex digit by 16 raised to the power of its position (rightmost = 16⁰), then sum the results. Treat A–F as 10–15. For example, 1A3F = 1×4096 + 10×256 + 3×16 + 15 = 6719. This is the inverse of decimal-to-hex and is the same procedure as hexadecimal-to-decimal.
1A3F → 6719
Powers of 16 grow quickly: 1, 16, 256, 4096, 65536. Memorizing the first few makes mental conversion much faster.
Try it above — enter your number and see the result instantly.