Hex Calculator

Add, subtract, multiply, and divide hexadecimal numbers or convert between Hex, Binary, and Decimal.

Hex Result

Hexadecimal (Base 16)45
Decimal (Base 10)69
Binary (Base 2)1000101

Four bits per digit

Hexadecimal is base 16, using 0-9 then A-F for ten through fifteen. Its value is entirely practical: one hex digit corresponds to exactly four binary bits, so a byte is always two hex characters and conversion needs no arithmetic — just a lookup, digit by digit. Binary11111111 is FF, which is 255.

That mapping is why hex appears wherever raw bytes surface. Colour codes like #FF5733are three bytes of red, green and blue. Memory addresses, MAC addresses, hashes and byte dumps all use it for the same reason — it is compact and it aligns with the underlying bits, which decimal does not.

Converting to decimal means multiplying each digit by its place value, a power of 16: 2Fis 2×16 + 15 = 47. Going the other way, divide repeatedly by 16 and read the remainders upward. Watch for prefix conventions when reading code — 0x in C-family languages,# in CSS, and a trailing h in some assembly dialects all mean the same thing.

Frequently asked questions

What is Hexadecimal (Hex)?

Hexadecimal is a base-16 positional numeral system that uses sixteen distinct symbols: 0-9 to represent values zero to nine, and A-F to represent values ten to fifteen.

How do I convert hexadecimal to decimal by hand?

Multiply each digit by 16 raised to its position, counting from zero on the right. So 0x2F is 2x16 + 15 = 47. Going the other way, divide repeatedly by 16 and read the remainders bottom-up. Hex digits run 0-9 then A-F for 10-15.

Why do programmers use hexadecimal?

Because one hex digit maps exactly onto four binary digits, so a byte is always exactly two hex characters and the conversion is mechanical. That makes memory addresses, colour values, bitmasks and binary file dumps far easier to read than long strings of ones and zeros, without the awkward grouping that decimal would impose.

How does hexadecimal arithmetic differ from decimal?

Only in when you carry: you carry at 16 rather than at 10. So 0x8 + 0x8 = 0x10 (sixteen), and 0xFF + 0x1 = 0x100. Subtraction borrows 16 rather than 10. The underlying algorithms are identical to the ones you learned for decimal.