Hex Calculator

Add, subtract, multiply and divide hexadecimal numbers, or convert between hex and decimal — with every step shown.

Hexadecimal calculation — add, subtract, multiply, divide


Convert hexadecimal to decimal


Convert decimal to hexadecimal

What is hexadecimal?

Hexadecimal — or hex — is a base-16 number system. Instead of the ten digits 0–9 used in the decimal system, hex uses sixteen symbols: the digits 0–9 followed by the letters A, B, C, D, E and F, which stand for the decimal values 10, 11, 12, 13, 14 and 15.

Because 16 is a power of 2 (16 = 2⁴), each hex digit maps to exactly four binary digits. That makes hex a compact, human-readable shorthand for binary — the string1111 1010 1100 1110becomes FACE. That's why hex shows up in color codes (#FF8800), memory addresses, MAC addresses, hash outputs and byte dumps.

Hex calculator, piece by piece

Each card explains one job the calculator does — reading a hex value into decimal, writing a decimal back into hex, and running the four arithmetic operations column-by-column in base 16.

Hex → decimal — how the digits are weighted

The rightmost hex digit is worth 1, the next 16, then 256 (=16²), and so on — the calculator multiplies every digit by its place value and sums. The letters A–F stand for 10–15, so a two-digit hex value fits the range 0–255, exactly one byte.

value = Σ digiti × 16i
digit_ihex digit 0–F at position i, with A=10…F=15·iposition from the right
2×256A×16F×1512 + 160 + 15= 687
Example
Given
2AF
Substitute
2·256 + 10·16 + 15·1
Answer
687

Decimal → hex — repeated division by 16

The reverse converter divides your decimal by 16, records the remainder (translating 10–15 back to A–F), and repeats on the quotient until it reaches zero. Reading the remainders bottom-up spells the hex value the calculator shows in the output.

nk+1 = ⌊nk / 16⌋
digitk = nk mod 16
stepquorem1000 ÷ 1662862 ÷ 163E3 ÷ 1603read up → 3E8
Example
Given
n = 1000
Substitute
3 divisions
Answer
3E8

Hex add & subtract — carry at 16, borrow 16

Hex addition uses the same column-by-column method as decimal, but the carry only fires when a column reaches 16, not 10. Subtraction borrows 16 from the next column. Under the hood the calculator runs the arithmetic in native big integers, then converts back to base 16 for display.

column ≥ 16 → write (col−16)
carry 1
carry: 1 5 D+ 7 C D 9carry at ≥ 16, not 10
Example
Given
5D + 7C
Substitute
D+C=25→9 c1
5+7+1=D
Answer
D9

Hex multiplication — long multiply with the F×F table

Multiplication follows the same shift-and-add layout as decimal long multiplication — multiply the top by each digit of the bottom, then sum the shifted rows in hex. The 16×16 table above is the base-16 version of the times table and is what the calculator uses for the single-digit products.

(top) × (bottom) = Σ (top × digitk) << 4k
carry: 2 1 F× 3 5 DF·3=45=2D; write D, carry 2
Example
Given
1F × 3
Substitute
F·3=2D, 1·3+carry
Answer
5D

Hex / decimal / binary quick reference

HexDecimalBinary (4-bit)
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111
14200001 0100
3F630011 1111
FF2551111 1111
1002561 0000 0000
3E8100011 1110 1000

Hexadecimal multiplication table

Features of this calculator

  • Add, subtract, multiply and divide two hex values
  • Convert hexadecimal to decimal with place-value working
  • Convert decimal to hexadecimal via repeated division by 16
  • Arbitrary-precision — handles very large hex numbers exactly
  • Includes a hex/binary/decimal reference and a 16×16 multiplication table

Frequently asked questions

+What is hexadecimal used for?

Hex is the standard shorthand for binary in computing — color codes, memory addresses, MAC addresses, hashes and byte-level file dumps all use it because one hex digit cleanly represents four binary digits.

+How do I convert hex to decimal by hand?

Multiply each digit by 16 raised to its position from the right, replacing A–F with 10–15, and add the results. Example: 2AF = 2·256 + 10·16 + 15 = 687.

+Why does hex use letters?

Base 16 needs sixteen distinct symbols. The digits 0–9 only cover ten, so A–F were chosen for the extra six. Using existing keyboard characters keeps hex easy to type and print.

+Can I enter negative hex values?

Yes — put a minus sign in front (e.g. −1F). This calculator uses signed arithmetic rather than two's complement, so you write the sign explicitly instead of picking a bit width.

+How is this different from the Binary Calculator?

Same idea, different base. Use the Binary Calculator for base 2, or the Number Base Converter to switch between binary, octal, decimal and hex in one step.

Related calculators