4.3 Number Bases: Binary, Octal, Decimal, and Hexadecimal

Key Takeaways

  • In a positional number system with base b, each digit is multiplied by a power of b: binary uses powers of 2, octal powers of 8, decimal powers of 10, and hexadecimal powers of 16.
  • One hexadecimal digit stands for exactly 4 bits, and one octal digit stands for exactly 3 bits, so converting between binary and these bases only requires grouping bits.
  • To convert a decimal integer to base b, divide repeatedly by b and read the remainders from last to first.
  • Hexadecimal digits A through F represent the values 10 through 15; for example, E7 in hexadecimal equals 14 × 16 + 7 = 231 in decimal.
  • To compare numbers written in different bases, convert them all to one base, usually decimal, before comparing.
Last updated: September 2026

What this competency asks

ETS asks you to understand number base conversion and binary, decimal, and hexadecimal number systems:

  1. Convert between number bases.
  2. Analyze and compare representations of numbers in different bases.

The discussion questions also mention octal, so be ready for base 8. Expect questions such as "What is the hexadecimal representation of this decimal number?" or "Which of these values is largest?", with the values written in mixed bases.

Positional notation

In base b, each position is worth a power of b, starting from b⁰ = 1 at the right. Each digit must be less than b.

BaseNameDigitsPlace values (right to left)
2Binary0, 11, 2, 4, 8, 16, 32, 64, 128, …
8Octal0–71, 8, 64, 512, …
10Decimal0–91, 10, 100, 1000, …
16Hexadecimal0–9, A–F1, 16, 256, 4096, …

In hexadecimal, A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. A subscript shows the base (E7₁₆, 11100111₂). Programming languages often use prefixes instead: 0x for hex, 0b for binary.

Powers of 2 worth memorizing

2⁰2¹2²2³2⁴2⁵2⁶2⁷2⁸2⁹2¹⁰
12481632641282565121024

Converting to decimal: expand by place value

Multiply each digit by its place value and add.

Binary to decimal: 11010110₂

Place value1286432168421
Digit11010110

128 + 64 + 16 + 4 + 2 = 214.

Hexadecimal to decimal: 3A4₁₆ = 3 × 256 + 10 × 16 + 4 × 1 = 768 + 160 + 4 = 932.

Octal to decimal: 1365₈ = 1 × 512 + 3 × 64 + 6 × 8 + 5 × 1 = 512 + 192 + 48 + 5 = 757.

Converting from decimal: repeated division

To convert a decimal integer to base b, divide by b, record the remainder, and repeat with the quotient until the quotient is 0. Read the remainders from bottom to top: the last remainder is the most significant digit.

156 to binary

DivisionQuotientRemainder
156 ÷ 2780 (least significant)
78 ÷ 2390
39 ÷ 2191
19 ÷ 291
9 ÷ 241
4 ÷ 220
2 ÷ 210
1 ÷ 201 (most significant)

Reading upward: 156 = 10011100₂. Check: 128 + 16 + 8 + 4 = 156.

500 to hexadecimal

DivisionQuotientRemainder
500 ÷ 16314
31 ÷ 16115 → F
1 ÷ 1601

Reading upward: 500 = 1F4₁₆. Check: 1 × 256 + 15 × 16 + 4 = 256 + 240 + 4 = 500.

ETS's sample question on this topic converts 231 to hexadecimal. Because 231 = 14 × 16 + 7, the answer is E7₁₆. The wrong choices differ by a single digit or a misplaced remainder, so always check your answer by converting back.

A faster alternative for binary is subtracting powers of 2. For 156, the largest power of 2 that fits is 128, leaving 28. Then 16 fits, leaving 12. Then 8, leaving 4. Then 4, leaving 0. Place 1s under 128, 16, 8, and 4 and 0s everywhere else.

Binary ↔ hexadecimal and octal: group the bits

Because 16 = 2⁴, each hex digit is exactly 4 bits (a nibble). Because 8 = 2³, each octal digit is exactly 3 bits.

Binary to hex: group from the right in fours, padding the leftmost group with zeros.

1011110101₂ → 0010 1111 0101 → 2, F, 5 → 2F5₁₆

Binary to octal: group from the right in threes.

1011110101₂ → 001 011 110 101 → 1, 3, 6, 5 → 1365₈

Hex to binary: replace each hex digit with its 4 bits.

9C7₁₆ → 9 = 1001, C = 1100, 7 = 0111 → 100111000111₂

All three results for 1011110101₂ agree: 2F5₁₆ = 1365₈ = 757₁₀.

Reference table, 0–15

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Analyzing and comparing representations

  • Comparing values: convert everything to decimal first. Example: which is largest, 3F₁₆, 1000000₂, 77₈, or 62₁₀? The values are 63, 64, 63, and 62, so 1000000₂ is largest.
  • Digit count: the same value needs more digits in a smaller base. 255 is 11111111 in binary (8 digits), 377 in octal (3 digits), and FF in hex (2 digits). That compactness is why programmers use hex.
  • Range of n digits: n binary digits represent 2ⁿ different values, from 0 to 2ⁿ − 1. Two hex digits (one byte) cover 0–255.
  • Recognizing invalid numbers: 129₈ is not a valid octal number, because octal has no digit 9. 1G₁₆ is not valid hex.
  • Quick parity check: a binary number is even exactly when its last bit is 0.

Where each base appears in computing

BaseCommon uses
BinaryHow hardware stores and processes all data
HexadecimalMemory addresses, color codes such as #FF8800, MAC addresses, IPv6 addresses, byte dumps
OctalUnix file permissions, such as chmod 755 (rwxr-xr-x)
DecimalHuman-facing input and output

Chapter 13 builds on these conversions with bits and bytes, character codes, colors, and two's complement.

Test Your Knowledge

What is the decimal value of 2E₁₆, and what is its 8-bit binary representation?

A
B
C
D
Test Your Knowledge

Which of the following values is the largest?

A
B
C
D
Test Your Knowledge

What is the hexadecimal representation of the decimal number 200?

A
B
C
D