Hexadecimal Calculator

Convert between decimal, binary, and hexadecimal values. Perform arithmetic operations on hexadecimal numbers.

For hexadecimal values, you can use prefix '0x' (e.g., 0x1A) or just enter the hex digits (e.g., 1A)

About the Hexadecimal Calculator

The Hexadecimal Calculator is a versatile tool designed to help with hexadecimal conversions and arithmetic operations. Whether you're a programmer, student, or digital enthusiast, this calculator simplifies working with hex numbers and different number systems.

Understanding Hexadecimal Numbers:

Hexadecimal (base-16) is a number system that uses 16 distinct symbols to represent values:

  • Digits 0-9: Represent values 0 to 9
  • Letters A-F: Represent values 10 to 15
  • Each hex digit represents 4 binary digits (bits)
  • Hexadecimal is commonly prefixed with "0x" (e.g., 0x1A)

Hexadecimal-Decimal Conversion Table:

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

Practical Applications of Hexadecimal:

  • Computer Memory Addressing: Memory locations are often represented in hexadecimal
  • Color Codes: Web colors use hex codes (e.g., #FF5733)
  • Assembly Language: Machine code and assembly often use hex representation
  • Debugging: Memory dumps and error codes are commonly displayed in hex
  • Network Addresses: MAC addresses use hexadecimal notation
  • Digital Systems: Used in digital electronics and microcontroller programming

How to Use This Calculator:

Conversion Mode:

  1. Enter any number in the input field
  2. Select the format of your input number (decimal, hex, or binary)
  3. Choose the desired output format
  4. Click "Calculate" to see the conversion results

Arithmetic Mode:

  1. Enter your first hexadecimal number
  2. Choose the operation you want to perform
  3. Enter the second hexadecimal number (if required)
  4. Select your desired result format
  5. Click "Calculate" to see the result

Bitwise Operations Explained:

OperationSymbolDescriptionExample
AND&Sets each bit to 1 if both bits are 10xA (1010) & 0x3 (0011) = 0x2 (0010)
OR|Sets each bit to 1 if at least one bit is 10xA (1010) | 0x3 (0011) = 0xB (1011)
XOR^Sets each bit to 1 if only one bit is 10xA (1010) ^ 0x3 (0011) = 0x9 (1001)
NOT~Inverts all bits~0xA (1010) = 0xFFFFFFF5 (depends on bit width)
Left Shift<<Shifts all bits left by the specified amount0x2 (0010) << 2 = 0x8 (1000)
Right Shift>>Shifts all bits right by the specified amount0x8 (1000) >> 2 = 0x2 (0010)

Common Hexadecimal Conversions:

DecimalHexadecimalBinary
00x00000
100xA1010
150xF1111
160x1000010000
2550xFF11111111
2560x100100000000

Tips for Working with Hexadecimal

  • Remember that each hex digit represents exactly 4 binary digits
  • Hex values are case-insensitive (0xAB equals 0xab)
  • Powers of 2 have simple hex representations (0x1, 0x2, 0x4, 0x8, 0x10, 0x20, etc.)
  • Hex is more compact than binary and easier to read for humans
  • When performing bitwise operations, thinking in binary often helps