Hex to Decimal Converter
Convert between hexadecimal, decimal, binary, and octal number systems.
Quick Examples
You May Also Like
What are Number Systems?
A number system is a way to represent numbers using a set of symbols. The base (or radix) determines how many unique digits are used.
We use decimal (base-10) in daily life because we have 10 fingers. Computers use binary (base-2) because electronic circuits have two states: on and off.
Hexadecimal is commonly used in computing because it compactly represents binary data - each hex digit equals exactly 4 binary digits (bits).
Common Number Bases
| Base | Name | Digits | Common Uses |
|---|---|---|---|
| 2 | Binary | 0-1 | Computer hardware, digital circuits |
| 8 | Octal | 0-7 | Unix file permissions, legacy systems |
| 10 | Decimal | 0-9 | Everyday counting, mathematics |
| 16 | Hexadecimal | 0-F | Colors, memory addresses, MAC addresses |
Hexadecimal Digits
Hexadecimal extends decimal by adding letters A-F to represent values 10-15:
| Hex | Dec | Hex | Dec |
|---|---|---|---|
| 0 | 0 | 8 | 8 |
| 1 | 1 | 9 | 9 |
| 2 | 2 | A | 10 |
| 3 | 3 | B | 11 |
| 4 | 4 | C | 12 |
| 5 | 5 | D | 13 |
| 6 | 6 | E | 14 |
| 7 | 7 | F | 15 |
How to Convert Between Bases
Decimal to Binary: Repeatedly divide by 2 and collect remainders (read bottom to top).
- 13 ÷ 2 = 6 remainder 1
- 6 ÷ 2 = 3 remainder 0
- 3 ÷ 2 = 1 remainder 1
- 1 ÷ 2 = 0 remainder 1
- Result: 13₁₀ = 1101₂
Binary to Hex: Group binary digits in sets of 4 (from right), convert each group.
- 11111111₂ = 1111 1111 = F F = FF₁₆
Hex to Decimal: Multiply each digit by its place value (powers of 16).
- FF₁₆ = (15 × 16¹) + (15 × 16⁰) = 240 + 15 = 255₁₀
Real-World Applications
Web Colors (CSS)
Colors are represented as 6 hex digits: #RRGGBB
#FF0000= Red (255, 0, 0)#00FF00= Green (0, 255, 0)#0000FF= Blue (0, 0, 255)#FFFFFF= White (255, 255, 255)
Memory Addresses Computer memory locations are typically shown in hex:
0x7FFF5FBFF8C0- a memory address
File Permissions (Octal) Unix/Linux uses octal for permissions:
755= rwxr-xr-x (owner: all, others: read+execute)644= rw-r--r-- (owner: read+write, others: read only)
MAC Addresses Network hardware addresses use hex:
00:1A:2B:3C:4D:5E
Why Programmers Love Hexadecimal
- Compact - One hex digit = 4 bits, so a byte (8 bits) = 2 hex digits
- Easy conversion - Binary ↔ Hex conversion is straightforward
- Human readable - Shorter than binary, easier to remember than long decimals
- Alignment - Works well with 8-bit, 16-bit, 32-bit, 64-bit systems