Hex Calculator

Hexadecimal (base 16) uses the digits 0–9 and A–F. Programmers use it for memory addresses, colours and byte values.

Results update as you type.

Result (hex)

B8E

Result in decimal
2,958
Inputs in decimal
2,703 + 255
Result in binary
1011 1000 1110

About this calculator

Enter two hex numbers, with or without 0x, and choose an operation.

How to use it

  1. Enter the first hex number.
  2. Choose the operation.
  3. Enter the second number.

The formula

Each hex digit is worth 16 raised to its position from the right
A–F
10 to 15

Worked example

0A8F + FF

  1. 0A8F is 2,703 and FF is 255.
  2. Sum = 2,958 = B8E in hex.

What the result means

Each hex digit is exactly four binary digits, which is why programmers like it.

Hex values worth knowing

Common hexadecimal values and their decimal equivalents
HexDecimalWhere you see it
7F127Largest signed 8-bit value
80128Top bit of a byte set
FF255Largest byte value, full colour channel
100256Number of values in one byte
3E81,000A round decimal number in hex
4001,024One kibibyte
FFFF65,535Largest 16-bit value, highest port number
1000065,536Number of values in 16 bits
7FFFFFFF2,14,74,83,647Largest signed 32-bit integer
FFFFFFFF4,29,49,67,295Largest unsigned 32-bit integer

Two practical examples

Pulling the blue channel out of a colour: the CSS colour #3A7BD5 is 3A7BD5 in hex. Choose AND with FF and the result is D5, which is 213 in decimal, the blue value. XOR with FFFFFF gives C5842A, the inverted colour.

Working out a memory offset: a buffer starts at 7FF0 and you need the address 40 bytes (hex) further on. 7FF0 + 40 = 8030, which is 32,752 + 64 = 32,816 in decimal. The carry from F + 4 ripples through, which is where manual hex addition usually goes wrong.

Common mistakes

  • Reading hex 10 as ten. It is 16; hex 20 is 32.
  • Expecting a fraction from division. 3E8 ÷ 7 gives 8E with remainder 6, because the calculator does whole-number division.
  • Expecting two’s complement for negative answers. FF − 100 is shown as −1 with a minus sign, not as FFFFFFFF.

Assumptions

  • Non-negative inputs for bitwise operations.

Limitations

  • Two’s complement is not shown.

Frequently asked questions

What is FF in decimal?

255.

How do I convert hex to binary?

Replace each hex digit with its four-bit binary value.

Can I type 0x?

Yes, the prefix is ignored.

Does it matter if I type capital or small letters?

No. 3e8 and 3E8 are the same number; results are shown in capitals.

How do I multiply a hex number by 16?

Add a 0 on the right, just as multiplying by 10 does in decimal. 1F4 × 10 (hex) = 1F40, which is 500 × 16 = 8,000.

Why do colour codes use hex?

Each colour channel runs from 0 to 255, and two hex digits cover exactly that range, from 00 to FF.

Last reviewed on 12 October 2026. How we calculate and check. Found a mistake? Tell us.