Hex Calculator

Hexadecimal math doesn't have to be a headache. Whether you're doing arithmetic in hex, converting between number systems, or just trying to make sense of a memory address in code, this calculator handles it all in one place. Below you'll find tools for hex arithmetic, hex-to-decimal and decimal-to-hex conversion, and hex-to-binary conversions in both directions. Each section includes a plain-English explanation of how the math works, so you're not just getting an answer, you actually understand where it came from.

Enter Details

Result

Convert hex to decimal or decimal to hex.

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Use the Hex Calculator

Using the calculator is straightforward. Select the operation you want, enter your hexadecimal values (digits 0–9 and letters A–F), and hit calculate. Results appear instantly, usually with a step breakdown so you can follow along.

A few things worth knowing before you start:

  • Hex digits are case-insensitive, so "1a" and "1A" are treated the same.
  • Don't include a "0x" prefix unless the tool specifically asks for it.
  • For arithmetic operations, both inputs must be valid hex values. If you enter a letter like G or a symbol, you'll get an error.
  • Negative numbers in hex are typically handled using two's complement, depending on the bit-width you select.

If you're converting rather than calculating, just pick the right converter section below and enter a single value. There's no second operand needed for conversion tools.

Hexadecimal Addition, Subtraction, Multiplication, and Division

Hex arithmetic follows the same rules as decimal arithmetic. The only real difference is that you're working in base 16 instead of base 10. That means instead of carrying over at 10, you carry over at 16.

Here's a quick breakdown of how each operation works in hex:

  • Addition: Add each column right to left. If the sum exceeds 15 (F in hex), subtract 16 and carry 1 to the next column. For example, 9 + 8 = 17 in decimal, which is 11 in hex (write 1, carry 1).
  • Subtraction: Borrow from the next column when needed, just like in decimal, but you're borrowing a group of 16 instead of 10.
  • Multiplication: Multiply as you normally would, convert intermediate results to hex, and carry accordingly. It gets messy fast, which is exactly why a calculator helps.
  • Division: Long division in hex is possible but tedious. Most people convert to decimal, divide, then convert back. The calculator skips all of that for you.

The hex digits A through F represent the decimal values 10 through 15. Once that clicks, the arithmetic starts feeling a lot more natural.

Hex to Decimal Converter

Converting hex to decimal means translating a base-16 number into base-10, which is the standard number system humans use every day.

The method is simple: multiply each hex digit by 16 raised to the power of its position, then add everything up. Positions are counted from right to left, starting at zero.

For example, to convert 2AF to decimal:

  1. F (15) × 16⁰ = 15
  2. A (10) × 16¹ = 160
  3. 2 × 16² = 512
  4. Total: 15 + 160 + 512 = 687

The converter below does all of this automatically. Just type in your hex value and the decimal equivalent appears right away. It works for both small values and large ones, including those long hex strings you might see in color codes or memory addresses.

Decimal to Hex Converter

Going the other direction, decimal to hex, involves repeatedly dividing by 16 and recording the remainders. It sounds more complicated than it is.

Here's how it works manually for the decimal number 255:

  1. 255 ÷ 16 = 15 remainder 15 (F)
  2. 15 ÷ 16 = 0 remainder 15 (F)
  3. Read the remainders bottom to top: FF

That's why #FFFFFF is white in CSS. All three color channels are maxed out at 255, which is FF in hex.

For larger numbers the division chain gets longer, but the logic stays the same. The converter handles all of it instantly. Just enter any whole decimal number and you'll get the hex equivalent. If you need a specific bit-width output (like 8-bit or 16-bit), look for a formatting option in the tool.

Hex to Binary Conversion

This conversion is actually one of the cleanest in all of number theory. Every single hex digit maps directly to exactly four binary digits (bits). No division, no remainders, just a straight substitution.

Here's the full mapping:

HexBinary
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001
A1010
B1011
C1100
D1101
E1110
F1111

To convert a hex number like 3F to binary, just replace each digit: 3 = 0011, F = 1111. Result: 00111111. That's it. Hex is so popular in computing precisely because of this clean relationship with binary.

Binary to Hex Conversion

Converting binary to hex is just the same table read in reverse. Group your binary digits into sets of four, starting from the right, then replace each group with its hex equivalent.

Take the binary number 10110101:

  1. Group into fours from the right: 1011 | 0101
  2. 1011 = B, 0101 = 5
  3. Result: B5

If your binary string doesn't divide evenly into groups of four, pad the left side with zeros. So 101 becomes 0101, which is just 5 in hex. The leading zeros don't change the value.

This grouping trick is the reason programmers prefer hex over decimal when reading raw binary data. A 32-bit number that would take 32 binary digits to write takes only 8 hex digits. Much easier to scan at a glance.

Hexadecimal Number System Explained

Hexadecimal is a base-16 number system. Where decimal uses ten symbols (0–9) and binary uses two (0 and 1), hex uses sixteen: the digits 0 through 9, plus the letters A through F to represent values ten through fifteen.

It became a staple in computing for a practical reason. Binary is what hardware actually speaks, but long strings of 0s and 1s are nearly impossible to read quickly. Hex compresses that binary data into a much shorter, human-readable format without losing precision. One hex digit always equals exactly four bits, so an 8-bit byte is always two hex digits, a 16-bit value is four, and so on.

You'll run into hex constantly in software development and hardware work:

  • Color codes in HTML and CSS (#FF5733, for example)
  • Memory addresses in debuggers and assembly language
  • MAC addresses on network interfaces
  • Error codes in operating systems and firmware
  • File formats and protocols where raw byte values need to be represented

Once you understand that hex is just a shorthand for binary, a lot of the mystery around it disappears. It's not a different kind of math. It's the same math, written in a more convenient alphabet.

Common Hexadecimal Conversion Examples

Sometimes the fastest way to build intuition for hex is just to see a bunch of examples side by side. Here are some commonly referenced values across all three number systems:

DecimalHexadecimalBinary
000000
10A1010
15F1111
16100001 0000
32200010 0000
64400100 0000
128801000 0000
255FF1111 1111
2561000001 0000 0000
10003E80011 1110 1000
65535FFFF1111 1111 1111 1111

Notice how 255 (FF) and 65535 (FFFF) represent the maximum values for 8-bit and 16-bit unsigned integers respectively. These numbers come up constantly in networking, graphics, and low-level programming. Getting familiar with them makes reading technical documentation a lot less painful.

Other Technology Calculators

Explore all