Hex calculator

Do arithmetic directly on hexadecimal numbers: offsets, sizes, addresses. Results come back in hex, decimal and binary.

Operation
Resulthex41F0
Decimalbase 1016880
Binarybase 2100000111110000
Inputsdecimal16384 + 496

Column addition, with carries

4000
+1F0
41F0

Work right to left. When a column adds to 16 or more, write the sum minus 16 and carry 1. F + 1 = 10.

Carrying at sixteen

Hex digits run 0–9 then A (10) to F (15). Adding works exactly like decimal except that a column carries when it reaches 16, not 10. The fastest way to check a column in your head is to convert both digits to decimal, add, and subtract 16 if the total is 16 or more.

To convert a single value, use hex to decimal or decimal to hex; to mask or shift bits, use the bitwise calculator.

Questions people ask

How do you add hex numbers?

Add column by column from the right. If a column reaches 16 or more, write the total minus 16 and carry 1. For example 9 + 8 = 17 = 11 hex (write 1, carry 1); A + 6 = 16 = 10 hex.

What is FF + 1 in hex?

100 (256 in decimal). FF is the largest two-digit hex value, like 99 in decimal.

Why would I do arithmetic in hex?

Memory offsets, pointer arithmetic, buffer sizes and colour channel maths are usually written in hex. Adding an offset like 0x1F0 to a base address 0x4000 is quicker to check in hex than by converting.

Does it support 0x prefixes and lowercase?

Yes, 0x7f, 7F and 7f all work.