Hex Calculator

Perform hexadecimal arithmetic and convert between hex and decimal number systems.

Hex Calculation — Add, Subtract, Multiply, or Divide

Result

Hex value:

8AB + B78

= 1423

Decimal value:

2219 + 2936

= 5155

= ?

Convert Hexadecimal Value to Decimal Value

Result

Decimal value: 3501

Hexadecimal Value: = ?

Convert Decimal Value to Hexadecimal Value

Result

Hexadecimal value: AA

Decimal Value: = ?

Complete Hex Calculator Guide & Information

1. What is Hexadecimal?

Hexadecimal (or hex) is a base-16 numeral system that uses sixteen distinct symbols: 0-9 to represent values zero to nine, and A-F (or a-f) to represent values ten to fifteen. Each hex digit represents four binary digits (bits), making hex a compact way to express binary values in computing and digital electronics.

Hexadecimal is widely used by programmers and system designers because it provides a human-friendly representation of binary-coded values. One byte (8 bits) can be represented with just two hexadecimal digits, compared to eight binary digits.

2. Hexadecimal Digit Reference

Hex Decimal Binary Hex Decimal Binary
000000881000
110001991001
220010A101010
330011B111011
440100C121100
550101D131101
660110E141110
770111F151111

3. Positional Notation

Like decimal, hexadecimal is a positional numeral system. Each digit's place represents a power of 16, starting from 0 at the rightmost position.

Example: 8AB₁₆
= 8 × 16² + A × 16¹ + B × 16⁰
= 8 × 256 + 10 × 16 + 11 × 1
= 2048 + 160 + 11
= 2219₁₀

4. Hexadecimal Arithmetic

Addition

Hex addition works similarly to decimal addition, but carries occur when the sum reaches 16 instead of 10. When a column sum exceeds 15 (F), carry 1 to the next higher column and keep the remainder.

Subtraction

Hex subtraction works like decimal subtraction. When borrowing in hex, you borrow 16 from the next higher digit, not 10 as in decimal.

Multiplication

Hex long multiplication follows the same structure as decimal long multiplication. Each digit in the second number is multiplied by the entire first number, shifted appropriately, and the intermediate results are summed using hex addition.

Division

Hex division is analogous to decimal long division. The divisor is repeatedly subtracted from the dividend using hex subtraction, building the quotient digit by digit. Integer division returns the whole-number quotient.

5. Conversion Methods

Hex to Decimal

Multiply each hex digit by 16 raised to its position power (starting from 0 on the right), then sum all products.

Decimal to Hex

Repeatedly divide the decimal number by 16, recording the remainder each time. Continue until the quotient becomes zero. Read the remainders from last to first — this is the hex value. Remainders 10-15 become A-F.

Example: 170 to hex
170 ÷ 16 = 10 rem 10 (A)
10 ÷ 16 = 0 rem 10 (A)
Result: AA₁₆

6. Binary ↔ Hex Conversion

Converting between binary and hex is extremely simple because each hex digit corresponds exactly to 4 bits.

7. Common Hex Uses in Computing

8. Input & Control Definitions

9. Hexadecimal Notation Conventions

10. Related Number Systems

11. References

1. Knuth, Donald E. "The Art of Computer Programming, Volume 2: Seminumerical Algorithms." Addison-Wesley. 1997.
2. Tanenbaum, Andrew S. "Structured Computer Organization." Pearson. 2012.
3. IEEE Standard for Floating-Point Arithmetic (IEEE 754). 2019.
4. Patterson, David A. and Hennessy, John L. "Computer Organization and Design." Morgan Kaufmann. 2020.
5. Stroustrup, Bjarne. "The C++ Programming Language." Addison-Wesley. 2013.