Skip to content

Hex Calculator

Do arithmetic and bitwise operations on hexadecimal numbers and see the result in hex, decimal, binary and octal side by side.

Formulas last reviewed: September 2026

Disclaimer: Results are calculated with standard formulas and are meant for learning and quick checks. Please double-check important work, especially anything used for exams, engineering, finance or safety.

Numbers in base 16

Hexadecimal (hex) uses sixteen digits: 0 to 9 and then A to F for the values ten to fifteen. Programmers like it because one hex digit equals exactly four binary digits, which makes long binary numbers short and readable.

You will meet hex in colour codes such as #FF5733, memory addresses, error codes and file dumps. This calculator adds, subtracts, multiplies, divides and applies AND, OR and XOR to hex numbers, and shows the answer in every common base.

How it is calculated

1A₁₆ = 1×16 + 10 = 26
FF₁₆ = 15×16 + 15 = 255

Worked example

FF + 1A

In decimal
255 + 26 = 281
Result in hex
119
Result in binary
100011001

Hex digit table

Counting in hex goes 0 1 2 3 4 5 6 7 8 9 A B C D E F and then rolls over to 10, which is sixteen in decimal. The letters simply stand for the values ten to fifteen.

HexABCDEF
Decimal101112131415

Frequently asked questions

Is hex case-sensitive?

No. ff, Ff and FF all mean 255. You may also start a number with 0x, as programmers often do.

How do I convert hex to decimal?

Multiply each digit by a power of 16 and add them up. For 2F that is 2×16 + 15 = 47.

What is a hex colour code?

A web colour such as #FF5733 is three hex pairs: red FF (255), green 57 (87) and blue 33 (51).

Why do computers use hex?

Because each hex digit stands for exactly four bits, so one byte is just two hex digits.