Hexadecimal Calculator

Perform arithmetic operations with hexadecimal numbers and convert between hex, decimal, binary, and octal number systems. Essential for programmers and computer science students.

Hexadecimal Calculator

Quick Examples

Number System Converter

Hex Color Preview

Red
255
Green
87
Blue
51

Calculation Result

16586
Hexadecimal Result
Decimal:91526
Binary:10110010110000110
Octal:262606

Step by Step

Hex A: A1B2 = Decimal 41394
Hex B: C3D4 = Decimal 50132
Operation: add
Result: 16586 = Decimal 91526

Number Conversions

Binary:11111111
Decimal:255
Hexadecimal:FF
Octal:377

Common Hex Values

0x000
0xFF255
0x100256
0x4001024
0x10004096
0xFFFF65535

How to Use This Calculator

This hexadecimal calculator allows you to perform arithmetic and bitwise operations with hex numbers, convert between number systems, and preview hex color codes.

  1. Enter your first hexadecimal number (using digits 0-9 and letters A-F)
  2. Select the operation you want to perform
  3. Enter the second hexadecimal number (if required)
  4. View the result in hex, decimal, binary, and octal formats
  5. Use the converter section to convert numbers between different bases
  6. Use the color preview to visualize hex color codes

Understanding Hexadecimal

What is Hexadecimal?

Hexadecimal (hex) is a base-16 number system that uses 16 distinct symbols: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15).

Why Use Hexadecimal?

  • Compact representation: One hex digit represents 4 binary digits
  • Memory addresses: Computer memory addresses are often displayed in hex
  • Color codes: Web colors are represented as 6-digit hex codes (RRGGBB)
  • Programming: Hex is commonly used in low-level programming

Hex to Decimal Conversion

Each position in a hex number represents a power of 16:

A1B2₁₆ = AƗ16³ + 1Ɨ16² + BƗ16¹ + 2Ɨ16⁰ = 10Ɨ4096 + 1Ɨ256 + 11Ɨ16 + 2Ɨ1 = 41394₁₀

Example Calculations

Hexadecimal Addition

A1 + B2 = 153

In decimal: 161 + 178 = 339

Bitwise AND

FF & AA = AA

In binary: 11111111 & 10101010 = 10101010

Color Code Example

FF5733 = Red: FF (255), Green: 57 (87), Blue: 33 (51)

This creates an orange-red color

Frequently Asked Questions

What does the '0x' prefix mean?

The '0x' prefix is a common notation in programming to indicate that a number is in hexadecimal format. For example, 0xFF represents the hex number FF.

How do I convert decimal to hexadecimal?

Divide the decimal number by 16 repeatedly and collect the remainders. Convert remainders 10-15 to A-F. For example, 255 Ć· 16 = 15 remainder 15 (F), 15 Ć· 16 = 0 remainder 15 (F). Result: FF.

Why is hexadecimal used for colors?

Hex color codes use 6 digits (RRGGBB) where each pair represents the intensity of red, green, and blue from 00 (0) to FF (255). This provides 16.7 million possible colors.