What is a hexadecimal number?
A hexadecimal number is a number expressed in base 16, using the digits 0–9 to represent values zero to nine, and the letters A–F to represent values ten to fifteen. The hexadecimal system is widely used in computing and digital electronics because it provides a compact, human-readable representation of binary values.
For example, in the hexadecimal system:
- The decimal number 10 is represented as A.
- The decimal number 15 is represented as F.
- The decimal number 255 is represented as FF.
Each hexadecimal digit represents four binary digits (bits), which makes conversion between binary and hexadecimal especially straightforward. This calculator allows users to perform addition, subtraction, multiplication, and division directly in hexadecimal form without manually converting between decimal and hex systems.
How the calculator works
This hexadecimal calculator simplifies arithmetic operations with hex numbers by following three main steps:
- Conversion to decimal (base 10) – Each hexadecimal input is converted to its decimal equivalent.
- Arithmetic operation – Addition, subtraction, multiplication, or division is performed on the decimal numbers.
- Conversion back to hexadecimal (base 16) – The resulting decimal value is converted back into hexadecimal notation.
The calculator handles multiple inputs simultaneously, which allows users to perform operations with two, three, or more hexadecimal numbers at once.
For instance, the operation 1A + F + 5 in hexadecimal involves three numbers and will produce the correct hexadecimal result in a single step.
If you need to convert numbers to hexadecimal number system, then use hexadecimal converter.
Step-by-step conversion
Example 1: Hexadecimal addition
Perform the addition in hexadecimal.
Step 1. Convert to decimal:
Step 2. Perform addition in decimal:
Step 3. Convert result to hexadecimal:
| Division | Integer quotient | Remainder |
|---|---|---|
| 41 ÷ 16 | 2 | 9 |
| 2 ÷ 16 | 0 | 2 |
So the hexadecimal result is .
Example 2: Hexadecimal subtraction
Compute in hexadecimal.
Step 1. Convert to decimal:
Step 2. Perform the subtraction in decimal:
Step 3. Convert to hexadecimal:
| Division | Integer quotient | Remainder |
|---|---|---|
| 50 ÷ 16 | 3 | 2 |
| 3 ÷ 16 | 0 | 3 |
So the hexadecimal result is .
Result:
Example 3: Hexadecimal multiplication
Compute in hexadecimal.
Step 1. Convert to decimal:
Step 2. Multiply in decimal:
Step 3. Convert to hexadecimal:
| Division | Integer quotient | Remainder |
|---|---|---|
| 50 ÷ 16 | 3 | 2 |
| 3 ÷ 16 | 0 | 3 |
So the hexadecimal result is .
Example 4: Hexadecimal division
Compute in hexadecimal.
Step 1. Convert to decimal:
Step 2. Perform division in decimal:
Step 3. Convert integer and fractional part to hexadecimal:
Integer part .
Fractional part
| Multiplication | Result | Remainder |
|---|---|---|
| 0.5 × 16 | 8 | 0 |
So the hexadecimal result is .
Conversion table
| Hex | Decimal | Binary |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
Interesting facts about hexadecimal
- The prefix “0x” is often used to indicate a hexadecimal value in programming languages (e.g.,
0xFF). - HTML and CSS use hexadecimal codes to represent colors; for example,
#FFFFFFis white and#000000is black. - The memory addresses in most computer systems are represented in hexadecimal format because it maps neatly to binary data.
- In early computers, hexadecimal helped programmers quickly read and debug binary machine code more easily.
Frequently Asked Questions
How to add multiple hexadecimal numbers like 1A + 2F + 3B?
Convert each number to decimal:
1A = 26, 2F = 47, 3B = 59.
Sum them: 26 + 47 + 59 = 132.
Convert back: 132 ÷ 16 = 8 remainder 4 → 84₁₆.
Result: 84.
Can hexadecimal numbers include fractional parts?
Yes. Fractional hexadecimal numbers use negative powers of 16.
Example: .
How to convert a large hexadecimal number like ABCD to decimal?
Expand:
So the decimal result is .