Number Bases Table

A complete conversion reference for the four most common number systems: decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16). Essential for computer science, digital electronics, and low-level programming.

How Number Bases Work

  • Decimal (base 10): digits 0–9. The system used in everyday arithmetic.
  • Binary (base 2): digits 0 and 1. Used internally by all digital computers.
  • Octal (base 8): digits 0–7. Common in Unix file permissions and legacy systems.
  • Hexadecimal (base 16): digits 0–9 and A–F. Used in memory addresses, color codes, and bytecode.

0 to 15 — Full Conversion Table

Complete table for the first 16 values (one nibble / half a byte). The hexadecimal digits A–F correspond to decimal 10–15.

DecimalBinary (4-bit)OctalHexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Common Byte Values (0–255)

Key 8-bit values in multiples of 16, plus the maximum byte value 255. Binary is shown with a space between the two nibbles for readability.

DecimalBinary (8-bit)OctalHexadecimal
00000 000000000
160001 000002010
320010 000004020
480011 000006030
640100 000010040
800101 000012050
960110 000014060
1120111 000016070
1281000 000020080
1441001 000022090
1601010 0000240A0
1761011 0000260B0
1921100 0000300C0
2081101 0000320D0
2241110 0000340E0
2401111 0000360F0
2551111 1111377FF

Powers of 2

Powers of 2 are fundamental in binary and hex — each power of 2 is a 1 followed by zeros in binary, and maps cleanly to hexadecimal boundaries.

n2ⁿ (Decimal)HexadecimalNotes
010x1
120x2
240x4
380x8
4160x10
5320x20
6640x40
71280x80
82560x1001 byte + 1
95120x200
101,0240x4001 KiB
112,0480x800
124,0960x1000
138,1920x2000
1416,3840x4000
1532,7680x8000
1665,5360x100001 segment (x86)
201,048,5760x1000001 MiB
2416,777,2160x100000016 MiB
301,073,741,8240x400000001 GiB
312,147,483,6480x80000000Absolute value of min signed 32-bit int (INT_MIN)
324,294,967,2960x100000000Max unsigned 32-bit int + 1 (UINT_MAX + 1)

Conversion Tips

  • Decimal → Binary: divide repeatedly by 2 and read remainders bottom-up.
  • Binary → Hex: group bits into nibbles of 4 from the right, then convert each nibble using the 0–15 table above.
  • Hex → Binary: expand each hex digit to its 4-bit binary equivalent.
  • Octal ↔ Binary: same as hex but with 3-bit groups instead of 4.
  • Prefix conventions: binary: 0b1010; octal: 0o12 or 012; hex: 0xFF.

References

See also