🧮

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.

Hexadecimal to Decimal Number Conversion Reference Table

Hexadecimal Code (Base-16)Decimal Value (Base-10)Binary Byte RepresentationPowers of 16 ExpansionComputer System Engineering Context
0x0000000 00000 × 16⁰ = 0Null byte / Zero value
0x0A100000 101010 × 16⁰ = 10ASCII Newline / First letter hex digit A
0x0F150000 111115 × 16⁰ = 15Maximum 4-bit nibble digit F
0x10160001 00001×16¹ + 0×16⁰ = 16Hexadecimal base-16 boundary
0x1A260001 10101×16¹ + 10×16⁰ = 26Standard conversion benchmark
0x7F1270111 11117×16¹ + 15×16⁰ = 127Maximum 7-bit signed byte
0x801281000 00008×16¹ + 0×16⁰ = 1288-bit byte mid-point boundary
0xFF2551111 111115×16¹ + 15×16⁰ = 255Maximum unsigned 8-bit byte
0x1002560001 0000 00001×16² + 0×16¹ + 0×16⁰ = 25616² power boundary
0x3E810000011 1110 10003×256 + 14×16 + 8×1 = 1000Decimal 1000 hex benchmark
0x7FF20470111 1111 11117×256 + 15×16 + 15×1 = 204711-bit CAN bus identifier max
0x100040960001 0000 0000 00001×16³ = 40964KB operating system memory page
0xFFFF655351111 1111 1111 111115×4096 + 15×256 + 15×16 + 15×1 = 65535Maximum 16-bit unsigned integer word

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 the formula for converting hex to decimal?
Multiply each hex digit by 16 raised to its positional index starting from 0 on the far right: Decimal = Sum(digit × 16^position). For example, 1A = (1 × 16¹) + (10 × 16⁰) = 16 + 10 = 26.
What do the hex letters A, B, C, D, E, and F stand for?
In base-16 hexadecimal: A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15.
How do I convert decimal back to hex?
Divide the decimal integer repeatedly by 16, write down the remainder (0-15 mapped to 0-9, A-F), then read the remainders in reverse order (bottom to top). For example, 255 ÷ 16 = 15 rem 15 → FF.
What is hex FF in decimal?
Hex FF equals decimal 255 (15 × 16 + 15 = 255), representing an 8-bit maximum byte value.
What is hex 100 in decimal?
Hex 100 equals decimal 256 (1 × 16² + 0 × 16¹ + 0 × 16⁰ = 256).
Why do programmers use hexadecimal instead of binary or decimal?
Hexadecimal provides a concise, human-readable shorthand for binary data. 1 hex digit represents exactly 4 binary bits (1 nibble), and 2 hex digits represent an 8-bit byte.
How do hex color codes map to RGB decimal values?
CSS hex colors `#RRGGBB` use 2 hex digits for each color channel. For example, `#FF5733` equals Red = FF (255), Green = 57 (87), Blue = 33 (51).
Does case matter in hexadecimal letters (A-F vs a-f)?
No. Hexadecimal digits are case-insensitive. '1a', '1A', '0x1a', and '0x1A' all represent decimal 26.