Home / ⚡ Geometry/ Hex Calculator

Hex Calculator

Print
Perform Hexadecimal calculations or convert values between Hex, Decimal, and Binary representations.
Hex Math
Hex to Dec
Dec to Hex
Calculation Result
Hex Result
23B
Decimal Value 571
Binary Equivalent 0010 0011 1011
Hex Place Value Mapping

The hexadecimal (base-16) number system operates identically to the decimal (base-10) and binary (base-2) systems. Instead of using ten or two symbols, hexadecimal uses 16 unique digits: 0 through 9 represent their standard values, while the letters A, B, C, D, E, and F (or lower-case a-f) represent the values 10 through 15. Every single hex digit represents exactly 4 binary digits (bits), commonly referred to as a nibble, making hex a highly efficient way to compress and read long binary strings in computer systems.

Our free Hex Calculator performs hexadecimal addition, subtraction, multiplication, and division, and provides bidirectional conversions between hexadecimal and decimal formats. Input your hex values or decimal numbers to see the step-by-step mathematical translation.


Converting Between Hex & Decimal

Each digit position in hexadecimal represents a power of 16 (16^n), starting with 16^0 on the far right. Below is a quick conversion reference:

  • A: 10 | B: 11 | C: 12 | D: 13 | E: 14 | F: 15

1. Hexadecimal to Decimal Conversion

Multiply each digit by its corresponding positional power of 16 and sum the results.

Example: Convert hex 2AA to decimal.

2AA = (2 × 16^2) + (A × 16^1) + (A × 16^0)

2AA = (2 × 256) + (10 × 16) + (10 × 1)

2AA = 512 + 160 + 10 = 682.

2. Decimal to Hexadecimal Conversion

To convert a decimal number to hex:

  1. Find the largest power of 16 that is less than or equal to your decimal number.
  2. Determine how many times that power of 16 divides into the number, noting this quotient.
  3. Multiply the quotient by the power of 16 and subtract it from your number to get the remainder Y.
  4. Repeat this process using the remainder Y as your new starting value.
  5. Convert quotients between 10 and 15 into their letter equivalents (A-F).

Example: Convert decimal 1500 to hex.

– Largest power of 16 in 1500 is 16^2 = 256. 256 goes into 1500 exactly 5 times (5 × 256 = 1280). remainder: 1500 - 1280 = 220.

– Largest power of 16 in 220 is 16^1 = 16. 16 goes into 220 exactly 13 times (13 × 16 = 208). remainder: 220 - 208 = 12.

– The remainder 12 is less than 16, so it occupies the 16^0 place.

– Positional values: 5, 13, and 12. Convert 13 to D and 12 to C.

1500 in decimal is equivalent to 5DC in hex.


Hexadecimal Arithmetic Operations

1. Hex Addition

Hex addition follows standard addition rules, but carrying occurs when the sum of a column equals or exceeds 16 (written as 10 in hex):

Addition Example: Solve 8AB + B78

  8AB (2219 decimal)

+  B78 (2936 decimal)

-------

= 1423 (5155 decimal).

– Right column: B + 8 = 11 + 8 = 19 (19 is one set of 16 with 3 left over, so write 3 and carry 1).

– Middle column: 1 (carry) + A + 7 = 1 + 10 + 7 = 18 (one set of 16 with 2 left over, so write 2 and carry 1).

– Left column: 1 (carry) + 8 + B = 1 + 8 + 11 = 20 (one set of 16 with 4 left over, so write 4 and carry 1).

2. Hex Subtraction

When subtracting in hex, borrowing 1 from the left column reduces that bit value by 1 and adds 16 decimal (not 10) to the borrowing column:

Subtraction Example: Solve 5DC – 3AF

  5DC (1500 decimal)

-  3AF (943 decimal)

-------

=  22D (557 decimal).

– Right column: C - F = 12 - 15. Borrow 1 from D, reducing D to C. The right column becomes 12 + 16 = 28. 28 - 15 = 13, which is D.

– Middle column: C - A = 12 - 10 = 2.

– Left column: 5 - 3 = 2.

3. Hex Multiplication

Multiplication utilizes shift-left rows and placeholders just like in decimal multiplication, using hex multipliers:

Multiplication Example: Solve FA × C3

      FA (250)

×     C3 (195)

---------

     2EE (3 × A = 1E, carry 1; 3 × F = 2D + 1 = 2E)

+   BB80 (C × A = 78, carry 7; C × F = B4 + 7 = BB; shift 0 added)

---------

=   BE6E (48,750).

4. Hex Division

Hex long division divides the values using hex multiplication and subtraction:

Divide FACE (64,206) by 12 (18):

       DEF (3,567)
    ------
 12 | FACE
    -   EA  (12 × D = EA)
    ------
       10C
     -  FC  (12 × E = FC)
     -----
       10E
     - 10E  (12 × F = 10E)
     -----
         0

The result is DEF.

Perform binary arithmetic conversions using our Binary Calculator or examine network subnet divisions with the IP Subnet Calculator.


Hexadecimal Multiplication Table

Because hexadecimal utilizes 16 digits, mental math multiplication can be challenging. The grid below serves as a reference table for cross-multiplying base-16 values (from 1 to 10 hex):

× 1 2 3 4 5 6 7 8 9 A B C D E F 10
1 1 2 3 4 5 6 7 8 9 A B C D E F 10
2 2 4 6 8 A C E 10 12 14 16 18 1A 1C 1E 20
3 3 6 9 C F 12 15 18 1B 1E 21 24 27 2A 2D 30
4 4 8 C 10 14 18 1C 20 24 28 2C 30 34 38 3C 40
5 5 A F 14 19 1E 23 28 2D 32 37 3C 41 46 4B 50
6 6 C 12 18 1E 24 2A 30 36 3C 42 48 4E 54 5A 60
7 7 E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69 70
8 8 10 18 20 28 30 38 40 48 50 58 60 68 70 78 80
9 9 12 1B 24 2D 36 3F 48 51 5A 63 6C 75 7E 87 90
A A 14 1E 28 32 3C 46 50 5A 64 6E 78 82 8C 96 A0
B B 16 21 2C 37 42 4D 58 63 6E 79 84 8F 9A A5 B0
C C 18 24 30 3C 48 54 60 6C 78 84 90 9C A8 B4 C0
D D 1A 27 34 41 4E 5B 68 75 82 8F 9C A9 B6 C3 D0
E E 1C 2A 38 46 54 62 70 7E 8C 9A A8 B6 C4 D2 E0
F F 1E 2D 3C 4B 5A 69 78 87 96 A5 B4 C3 D2 E1 F0
10 10 20 30 40 50 60 70 80 90 A0 B0 C0 D0 E0 F0 100

Perform binary arithmetic conversions using our Binary Calculator or examine network subnet divisions with the IP Subnet Calculator.


Frequently Asked Questions (FAQ)

What is a nibble in computer science?

A nibble is a group of four binary digits (bits), representing half of a standard 8-bit byte. Since 4 bits can represent 16 unique values (0 to 15), a single hexadecimal digit corresponds to exactly one nibble.

Why do programmers use hexadecimal instead of binary?

Hexadecimal is much more readable and compact than binary, while still maintaining a clean relationship with computer memory. A single byte (8 bits) can be written as just two hex characters (e.g., 11111111 in binary is FF in hex), which reduces visual clutter and decreases coding errors.

What does borrowing a 1 mean in hex subtraction?

In decimal, borrowing a 1 from the next column adds 10 to the current column. Because hex is base-16, borrowing a 1 from the column to the left adds 16 decimal to your current column, while the borrowed column decreases by 1.

How does hexadecimal relate to HTML color codes?

HTML colors are represented using hex codes (such as #FF5733) that describe the intensity of Red, Green, and Blue (RGB) channels. Each color channel uses 1 byte (8 bits), which translates to a 2-digit hex number ranging from 00 (intensity 0) to FF (intensity 255).