Add, subtract, multiply or divide two hexadecimal numbers, or convert a number between hex and decimal.
Enter two hex numbers, using the digits 0 to 9 and the letters A to F, and pick an operation.
Convert a hexadecimal number to a decimal number.
Convert a whole decimal number to hexadecimal.
| Decimal | Hex | Binary | Decimal | Hex | Binary |
|---|---|---|---|---|---|
| 0 | 0 | 0000 | 8 | 8 | 1000 |
| 1 | 1 | 0001 | 9 | 9 | 1001 |
| 2 | 2 | 0010 | 10 | A | 1010 |
| 3 | 3 | 0011 | 11 | B | 1011 |
| 4 | 4 | 0100 | 12 | C | 1100 |
| 5 | 5 | 0101 | 13 | D | 1101 |
| 6 | 6 | 0110 | 14 | E | 1110 |
| 7 | 7 | 0111 | 15 | F | 1111 |
Hexadecimal, or hex, counts in base 16. It needs sixteen digits, so after 0 to 9 it uses the letters A to F for the values 10 to 15. Each place is worth sixteen times the one to its right. The hex number 2F is 2 × 16 plus 15, which is 47 in decimal. Hex is popular in computing because one hex digit stands for exactly four binary digits, so long binary numbers become short and easier to read.
You meet hex in web colors such as #FF8800, where each pair of digits sets the red, green and blue amounts. It also appears in memory addresses, in MAC addresses, in character codes and in the byte values that programmers read when they debug. Two hex digits make up one byte, with values from 00 to FF, which is 0 to 255 in decimal.
The first calculator adds, subtracts, multiplies and divides two hex numbers and shows the same sum in decimal so you can check it. Division gives a whole quotient and a remainder. The other two calculators convert in each direction. Letters can be typed in upper or lower case, results are shown in upper case, and negative whole numbers can be entered with a minus sign. The sums are exact for numbers of any size.
Add the digits column by column from the right, using decimal values for the letters. When a column reaches 16 or more, write the remainder and carry 1. For example, 8AB + B78 is 1423.
They stand for the values 10 to 15: A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15.
Multiply each digit by 16 raised to its position, counting from 0 at the right, and add them up. DAD is 13 × 256 + 10 × 16 + 13, which is 3,501.
Divide the number by 16 repeatedly and keep the remainders, writing 10 to 15 as A to F. Reading the remainders from last to first gives the hex number.
One hex digit equals exactly four binary digits, so a byte is two hex digits. It is a compact way to write binary values.
Pick another tool to jump straight to it.