Binary to Decimal to Hexadecimal – Number System Conversion Guide (2026)

Binary to Decimal to Hexadecimal – Number System Conversion Guide (2026)

June 10, 2026 | 10 min read | For computer science, digital electronics, and IT students

If you are studying computer science, digital electronics, or any programming related field, you cannot avoid number systems. Computers work on binary (base 2). Humans use decimal (base 10). And for compact representation, we use hexadecimal (base 16). You need to know how to convert between these systems quickly and correctly. In this guide, I will show you step-by-step methods for binary to decimal, decimal to binary, binary to hexadecimal, hexadecimal to binary, and decimal to hexadecimal conversions. I will also give you a free converter tool link at the end.

Quick summary: Binary uses digits 0 and 1. Decimal uses 0-9. Hexadecimal uses 0-9 and A-F (A=10, B=11, C=12, D=13, E=14, F=15). To convert binary to decimal, multiply each bit by powers of 2. To convert decimal to binary, repeatedly divide by 2. To convert binary to hex, group bits in fours. Hex to binary expands each digit to 4 bits.

1. Binary to Decimal Conversion

Binary numbers use base 2. Each digit (bit) represents a power of 2, starting from the rightmost bit as 2^0. To convert binary to decimal, multiply each bit by its place value and sum them.

Method: Write the binary number. Starting from the right (least significant bit), multiply each bit by 2 raised to its position index (0,1,2,…). Add all results.

Example 1: Binary 1011 to Decimal

Binary: 1 0 1 1
Positions from right: 3 2 1 0
Calculation: (1 × 2^3) + (0 × 2^2) + (1 × 2^1) + (1 × 2^0)
= (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1) = 8 + 0 + 2 + 1 = 11 decimal.

Example 2: Binary 11001 to Decimal

Bits: 1 1 0 0 1
Positions: 4 3 2 1 0
= (1×16)+(1×8)+(0×4)+(0×2)+(1×1) = 16+8+0+0+1 = 25 decimal.

Example 3: Binary 11111111 (8-bit all ones) to Decimal

= 128+64+32+16+8+4+2+1 = 255 decimal. This is the maximum for 8 bits.

2. Decimal to Binary Conversion

To convert a decimal number to binary, repeatedly divide the number by 2 and record the remainders (0 or 1). The remainders read from bottom to top give the binary representation.

Example 1: Decimal 25 to Binary

25 ÷ 2 = 12 remainder 1
12 ÷ 2 = 6 remainder 0
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read remainders bottom to top: 11001. So 25 decimal = 11001 binary.

Example 2: Decimal 156 to Binary

156 ÷ 2 = 78 rem 0
78 ÷ 2 = 39 rem 0
39 ÷ 2 = 19 rem 1
19 ÷ 2 = 9 rem 1
9 ÷ 2 = 4 rem 1
4 ÷ 2 = 2 rem 0
2 ÷ 2 = 1 rem 0
1 ÷ 2 = 0 rem 1
Reading bottom up: 10011100. So 156 decimal = 10011100 binary.

3. Binary to Hexadecimal Conversion

Hexadecimal is base 16. Each hex digit corresponds to 4 binary bits (a nibble). To convert binary to hex, group the binary digits into groups of 4 starting from the right. Pad the leftmost group with leading zeros if needed. Then replace each 4-bit group with its hex equivalent.

Here is the binary-to-hex mapping table:

Binary (4 bits)HexadecimalDecimal
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
1010A10
1011B11
1100C12
1101D13
1110E14
1111F15

Example 1: Binary 11011011 to Hex

Group from right: 1101 1011
1101 = D, 1011 = B
So hex = DB. (DB in hex = 219 decimal)

Example 2: Binary 101011101 to Hex

Binary: 101011101. Group from right: 0001 0101 1101 (add leading zeros to make leftmost group 4 bits).
0001 = 1, 0101 = 5, 1101 = D.
So hex = 15D.

4. Hexadecimal to Binary Conversion

This is the reverse. Replace each hex digit with its 4-bit binary equivalent using the same table. Then concatenate the groups.

Example: Hex 3A7 to Binary

3 = 0011, A = 1010, 7 = 0111
So binary = 001110100111. Remove leading zeros if needed: 1110100111 (but keeping 12 bits is fine).

5. Decimal to Hexadecimal Conversion

Two methods: either convert decimal to binary first then binary to hex, or directly divide by 16 repeatedly (similar to decimal to binary but with base 16). Remainders 10-15 are represented as A-F.

Method 1 (Divide by 16):

Convert 456 decimal to hex:
456 ÷ 16 = 28 remainder 8 (least significant digit)
28 ÷ 16 = 1 remainder 12 (C)
1 ÷ 16 = 0 remainder 1
Read remainders from bottom to top: 1, C, 8 → 1C8 hex.

Method 2 (via binary):

Convert 456 to binary: 456 = 256+128+64+8 = 111001000 binary. Group into 4-bit: 0001 1100 1000 = 1C8 hex. Same result.

6. Hexadecimal to Decimal Conversion

Multiply each hex digit by 16 raised to its position (rightmost position 0). For digits A-F, use decimal values 10-15.

Example: Hex 1C8 to Decimal

Positions: 1 (16^2), C=12 (16^1), 8 (16^0)
= (1 × 256) + (12 × 16) + (8 × 1) = 256 + 192 + 8 = 456 decimal.

Summary Table of Conversions

Conversion TypeMethodExample
Binary → DecimalMultiply bits by powers of 2 and sum1011₂ = 11₁₀
Decimal → BinaryRepeated division by 2, read remainders bottom-up25₁₀ = 11001₂
Binary → HexGroup 4 bits from right, convert each group11011011₂ = DB₁₆
Hex → BinaryEach hex digit to 4 bits3A7₁₆ = 001110100111₂
Decimal → HexDivide by 16 repeatedly, remainders (10-15 as A-F)456₁₀ = 1C8₁₆
Hex → DecimalMultiply digits by powers of 161C8₁₆ = 456₁₀

Common Mistakes to Avoid

  • Forgetting that binary to hex grouping starts from the rightmost bit, not leftmost.
  • Misplacing the powers in binary to decimal (starting from 2^0 at the rightmost bit).
  • Using wrong hex letters (A=10, not A=1).
  • Not padding binary groups with leading zeros when the leftmost group has less than 4 bits.
  • Confusing between decimal and hexadecimal when reading numbers like 12 (which is C in hex, not 12).
Tip for students: Practice with small numbers first. Check your work by converting back to the original system. Once you are comfortable, you can do conversions in your head for common values (like 0-255).

Use Our Free Number System Converter

If you need quick conversions or want to verify your manual work, use the number system converter tool on this site. It supports binary, decimal, hexadecimal, and also octal. Just enter a number in any base and see the equivalent in other bases instantly.

Try Number System Converter

Convert between binary, decimal, hex, and octal

Frequently Asked Questions

1. Why do computers use binary instead of decimal?
Computers use binary because electronic circuits have two stable states (on/off, high/low voltage). Representing ten states (0-9) would be much more complex and error-prone. Binary is simpler and reliable for digital logic.
2. Why is hexadecimal used?
Binary numbers become very long (e.g., 255 decimal is 11111111 binary). Hexadecimal is more compact: each hex digit represents 4 bits, so 8-bit binary becomes 2 hex digits. It is easier for humans to read and write.
3. How do I convert a decimal fraction (like 0.625) to binary?
Multiply the fractional part by 2 repeatedly. For 0.625: 0.625×2=1.25 → integer part 1, remainder 0.25; 0.25×2=0.5 → 0; 0.5×2=1.0 → 1. So binary fraction = 0.101. This guide focuses on integers, but the same concept applies.
4. What about negative numbers in binary?
Negative numbers are represented using two’s complement. The most significant bit (MSB) indicates sign (1 for negative). Converting negative numbers requires a different method, usually beyond basic conversion. Most introductory courses cover that separately.
5. How do I convert between octal and binary?
Octal (base 8) uses 3-bit groups. Similar to hex but with groups of 3 bits. Our number system converter includes octal as well. The principles are the same: each octal digit maps to 3 binary bits (0=000, 1=001, …, 7=111).
(c) 2026 EnggPrep – Number system tutorials and tools for computer science and electronics students.

Leave a Comment