Hex Calculator

Convert between hexadecimal, decimal, binary, and octal. Perform hex arithmetic and bitwise operations.

Hex Converter (edit any field)

Hex Arithmetic

Result (Hex)

29

Result (Decimal)

41

How to Use the Hex Calculator

Converter: Type in any field (hex, decimal, binary, or octal) and all other fields update automatically. You can start from any base.

Arithmetic: Enter two hexadecimal numbers in the Hex A and Hex B fields, select an operation, and the result appears in both hex and decimal. Use 0-9 and A-F (case insensitive). For example, enter "1A" for decimal 26, or "FF" for decimal 255.

Hexadecimal Reference

Hex digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal:    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Converting hex to decimal:
  Each position is a power of 16 (right to left: 16^0, 16^1, 16^2...)
  Example: 2AF hex
    = 2×16² + A×16¹ + F×16⁰
    = 2×256 + 10×16 + 15×1
    = 512 + 160 + 15 = 687

Converting decimal to hex:
  Divide by 16, note remainder, repeat until quotient is 0.
  Read remainders from bottom to top.
  Example: 687
    687 ÷ 16 = 42 r 15 (F)
     42 ÷ 16 =  2 r 10 (A)
      2 ÷ 16 =  0 r  2
  Result: 2AF

1 hex digit = 4 binary bits
FF hex = 11111111 binary = 255 decimal

Frequently Asked Questions

Hexadecimal (base 16) is a number system using 16 symbols: 0-9 and A-F. It is widely used in computing because each hex digit represents exactly 4 binary bits, making it a compact notation for binary data. Common uses include HTML color codes (#FF5733), memory addresses, error codes, and low-level programming. The byte 11111111 in binary is simply "FF" in hex, which is much easier to write.

Related Calculators