🧮

Hex to Decimal Calculator – Convert Hexadecimal ↔ Decimal

Hex ↔ Decimal

The Hex to Decimal Calculator converts hexadecimal (base‑16) numbers to decimal (base‑10) and vice versa. Hexadecimal is widely used in computing because it is a compact representation of binary – each hex digit corresponds to 4 bits. This calculator shows the complete conversion process: for hex→dec, place‑value multiplication; for dec→hex, repeated division by 16. It's an essential tool for programmers, computer science students, and anyone working with low‑level data.

Hexadecimal Place Values409616^325616^21616^1116^0Example: 0x1A = 1×16 + 10×1 = 26

How to Convert Hexadecimal to Decimal

Step 1: Write the hex digits with their place values (powers of 16, starting from 0 on the right).

Step 2: Convert each hex digit to decimal (A=10, B=11, …, F=15).

Step 3: Multiply each digit by its place value and sum the results.

Example: 1A (hex) = 1×16 + 10×1 = 16 + 10 = 26 decimal.

How to Convert Decimal to Hexadecimal

Step 1: Divide the decimal number by 16.

Step 2: Write the remainder (0‑15) as a hex digit (0‑9, A‑F).

Step 3: Repeat with the quotient until it becomes 0.

Step 4: Read remainders from bottom to top – that is the hex number.

Example: 255 → 255÷16=15 rem 15 (F), 15÷16=0 rem 15 (F) → FF hex.

Hexadecimal Conversion Table (0‑15)

DecimalHex
00
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F

Real‑World Applications of Hexadecimal

  • Color codes: Web colors (e.g., #FF5733 = red, green, blue).
  • Memory addresses: CPU registers and pointers are often displayed in hex.
  • MAC addresses: Device identifiers (e.g., 00:1A:2B:3C:4D:5E).
  • Debugging: Hex dumps show binary data in a compact, readable form.
Why Hexadecimal?

Hexadecimal is a natural shorthand for binary. Each hex digit represents exactly 4 bits, so a byte (8 bits) is two hex digits. For example, binary 11111111 = FF hex = 255 decimal. This compactness makes hex ideal for displaying large binary numbers in programming and debugging.

Common Mistakes When Converting Hex to Decimal

  • Forgetting that A‑F represent 10‑15: A = 10, B = 11, …, F = 15.
  • Incorrect place values: The rightmost digit is 16⁰ = 1, not 16¹.
  • Mixing uppercase/lowercase: Our calculator accepts both, but always treat hex letters as case‑insensitive.
  • Leaving a leading 0x prefix: The calculator expects plain hex (e.g., FF, not 0xFF).

Binary, Hexadecimal, and Decimal: A Quick Comparison

The same number can be represented in any base. For example, the decimal 26 is 11010 in binary and 1A in hexadecimal. Hexadecimal is easier for humans to read than long binary strings, while still being machine‑friendly. Mastering these conversions is fundamental for low‑level programming, embedded systems, and computer architecture.

Use this hex to decimal calculator for coding projects, electronics, or homework. The step‑by‑step explanations help you internalise the conversion rules, so you can eventually perform them mentally.

Step‑by‑Step Manual Example

Hex 1A → Decimal: 1×16 + 10×1 = 16 + 10 = 26.

Decimal 255 → Hex: 255÷16=15 rem 15 (F); 15÷16=0 rem 15 (F) → read remainders bottom to top: FF.

Frequently Asked Questions about Hexadecimal

What is hexadecimal?
Hexadecimal (base‑16) uses digits 0‑9 and letters A‑F (where A=10, B=11, C=12, D=13, E=14, F=15). It is commonly used in computing because each hex digit represents 4 bits.
How do I convert hex to decimal?
Multiply each hex digit by 16 raised to its position (rightmost is 0), then sum the results. For example, 1A = 1×16 + 10×1 = 26.
How do I convert decimal to hex?
Repeatedly divide by 16, record remainders (0‑15 → 0‑9,A‑F), then read from bottom to top. Example: 255 → 255÷16=15 rem 15 (F), 15÷16=0 rem 15 (F) → FF.
Where is hexadecimal used?
Memory addresses, color codes (e.g., #FF5733), MAC addresses, and low‑level programming.