How this calculator works
- Step 1Place values…256 16 1Each place is worth sixteen times the one to its right.
- Step 2Digits0–9, A–FA is 10 and F is 15.
- Step 3Every baseExactThe answer is shown in hex, decimal, octal and binary.
Hexadecimal, or base 16, packs four binary digits into each hex digit, which is why programmers use it for colours, memory addresses and bytes. FF is 15 × 16 + 15 = 255.
Worked example: FF + 1A
- Rule
a column total of 16 or more carries 1
- FF15 × 16 + 15255
- 1A1 × 16 + 1026
- Sum in hex119
- Sum in decimal255 + 26281
The same method, carrying when a column reaches the base, is how OpenStax adds in bases 6 and 12.
Arithmetic and bitwise operations
- ArithmeticFF × FF = FE01Whole-number division too: 64 ÷ 7 = E r 2.
- BitwiseDEAD XOR BEEF = 6042AND, OR and XOR compare the bits.
Read the result
The headline is the answer in hexadecimal; the table repeats it in binary, octal and decimal.
Assumptions and limits
- Whole numbersNo hex fractions.
- Any sizeExact up to 32 hex digits in each input.
- Sign, not two’s complementNegative numbers use a minus sign.
Related base tools
Each hexadecimal digit stands for four binary digits, so the two convert directly.
For base-2 arithmetic, use the binary calculator. Web colours are written in hex; the color converter turns them into RGB, HSL and OKLCH.
Common mistakes
Mistake: Treating 10 in hex as ten.
Instead: Hex 10 is sixteen; check the decimal line.
Mistake: Using G or higher letters.
Instead: Hex digits stop at F, which is 15.
Checking the method
Every golden case is rechecked with Python’s own base-16 conversion.
An independent script reads numbers with Python’s int(text, 16) and writes results with its hexadecimal formatting.
Read how we test our calculators, or browse more maths calculators.