CalcNova Sign in

Hex Calculator

Perform addition, subtraction, multiplication, and division on hexadecimal values, and convert between hexadecimal and decimal values.

AdSense Space (In-Article Fluid)

Hexadecimal Calculation — Add, Subtract, Multiply, or Divide

= ?

Convert Hexadecimal Value to Decimal Value

Convert Decimal Value to Hexadecimal Value

The Hexadecimal System

The hexadecimal number system (hex) functions virtually identically to the decimal and binary systems — it simply uses a base of 16 instead of 10 or 2. Hex uses the digits 0–9 as decimal does, plus the letters A, B, C, D, E, and F to represent the values 10–15 (lowercase a–f mean the same). Every hex digit represents exactly 4 binary digits, called a nibble, which makes large binary numbers much simpler to write: the binary value 1010101010 is just 2AA in hex. This is why computers use hex to compress large binary values into a form that converts easily between the two systems.

Hex/Decimal Conversion

HexBinaryDecimal
000
111
2102
3113
41004
51015
61106
71117
810008
910019
A101010
B101111
C110012
D110113
E111014
F111115
141010020
3F11111163

Converting between hex and decimal

Converting between decimal and hex uses the place values of each system, in much the same way as binary conversion. In 2AA, the rightmost A is the ones place (160), the next A is the 161 place, and the 2 is the 162 place. Since A counts as 10: 2AA = (2 × 162) + (A × 161) + (A × 160) = (2 × 256) + (10 × 16) + (10 × 1) = 512 + 160 + 10 = 682. The same method works for any hex value — for example, 1024 = (1 × 163) + (0 × 162) + (2 × 161) + (4 × 160) = 4096 + 0 + 32 + 4 = 4132.

Going the other way, from decimal to hex: find the largest power of 16 that fits in the number, note how many times it goes in — that count is the digit for that place — subtract that many times the power, and repeat with the remainder until 16 is larger than what is left; the final remainder is the 160 digit. For 1500: the largest power is 162 = 256, and 256 × 5 = 1280, leaving 220; 16 × 13 = 208, leaving 12; 12 is the ones digit. So 1500 = (5 × 162) + (13 × 161) + (12 × 160), and since 13 is D and 12 is C, 1500 is 5DC in hex.

Hex Addition

Hex addition follows the decimal rules, with the letter numerals A–F as the only extra ingredient — it helps to keep their decimal values (10–15) in mind. Work column by column in decimal and convert back: in the calculator's default example, B + 8 = 11 + 8 = 19, and 19 is 13 in hex, so write 3 and carry 1; the next column is 1 + A (10) + 7 = 18, which is 12 in hex — write 2, carry 1; the last column is 1 + 8 + B (11) = 20, which is 14 in hex. So 8AB + B78 = 1423.

Hex Subtraction

Subtraction works the same way, except for borrowing: a borrowed "1" in hex is worth 16, not 10, because the column it comes from is 16 times larger. In 5DC − 3AF, the first column has C (12) − F (15), so borrow from the D: D becomes C, and the first column computes 16 + 12 − 15 = 13, which is D. The remaining columns need no borrowing: C − A = 2 and 5 − 3 = 2, giving 22D. If the number being subtracted is larger, swap the two, subtract, and put a negative sign on the result — 3AF − 5DC = −22D.

Hex Multiplication

Multiplication is the trickiest of the four by hand, because the products are bigger and constant conversion between hex and decimal is needed at each step — a multiplication table (below) helps. The method is otherwise the familiar one: multiply by each digit, convert each partial result to hex, shift, and add. For example, FA × C3: 3 × A = 1E and 3 × F = 2D with the carry makes 2EE for the first row; C × A = 78 and C × F = BB for the second row (BB80); adding gives BE6E.

Hex Division

Long division in hex is identical to long division in decimal, except that the multiplications and subtractions along the way are done in hex (converting to decimal, dividing, and converting back also works). For example, FACE ÷ 12 proceeds: 12 × D = EA, FA − EA = 10; bring down C, 12 × E = 10C, 10C − FC = 10; bring down E, 12 × F = 10E, remainder 0 — quotient DEF. Remember that borrowing during the hex subtractions moves 16, not 10.

Hexadecimal Multiplication Table

×123456789ABCDEF10
1123456789ABCDEF10
22468ACE10121416181A1C1E20
3369CF1215181B1E2124272A2D30
448C1014181C2024282C3034383C40
55AF14191E23282D32373C41464B50
66C12181E242A30363C42484E545A60
77E151C232A31383F464D545B626970
88101820283038404850586068707880
99121B242D363F48515A636C757E8790
AA141E28323C46505A646E78828C96A0
BB16212C37424D58636E79848F9AA5B0
CC1824303C4854606C7884909CA8B4C0
DD1A2734414E5B6875828F9CA9B6C3D0
EE1C2A38465462707E8C9AA8B6C4D2E0
FF1E2D3C4B5A69788796A5B4C3D2E1F0
10102030405060708090A0B0C0D0E0F0100

Frequently Asked Questions

How do you convert hex to decimal?

Multiply each hex digit by its place value — powers of 16 starting from 160 on the right — and add the results, counting A through F as 10 through 15. For example, 2AA = (2 × 256) + (10 × 16) + (10 × 1) = 682.

How do you convert decimal to hex?

Find the largest power of 16 that fits in the number, count how many times it goes in (that count is the hex digit for that place), subtract, and repeat with the remainder. For example, 1500 = (5 × 256) + (13 × 16) + 12, and since 13 is D and 12 is C, 1500 is 5DC in hex.

Why is hexadecimal used in computing?

Each hex digit represents exactly 4 binary digits (a nibble), so long binary values compress into short hex strings that convert back exactly — the binary value 1010101010 is simply 2AA in hex. Memory addresses, color codes, and byte values are therefore usually written in hex.

How does hex addition work?

Add column by column as in decimal, converting A–F to 10–15 as needed, and carry 1 to the next column whenever a column totals 16 or more. For example, B + 8 = 19 in decimal, which is 13 in hex: write 3, carry 1.