Skip to main content
Hex calculator

Do the math in hexadecimal.

Enter two hex numbers, pick an operation, and see the result in hex, decimal, binary and octal at once, with each input broken down across every base.

Your numbers

0x
0x
Valid characters: 0-9 and A-F
Result in hex
0x0
first + second

Each input across the bases

ValueHexDecimalBinaryOctal

What this means

    How hexadecimal works

    Understanding Hexadecimal Numbers

    Hexadecimal (base-16) uses digits 0-9 and letters A-F to represent values 0-15. It is widely used in computing because each hex digit represents exactly 4 binary digits (bits), making it a compact way to express binary data. For example, the decimal number 255 is FF in hex and 11111111 in binary. Hex is ubiquitous in color codes (#FF0000), memory addresses, and data encoding.

    Converting Between Number Systems

    This calculator takes decimal inputs and displays results in four number systems: decimal (base-10), hexadecimal (base-16), binary (base-2), and octal (base-8). Enter decimal numbers and the calculator converts them to hex and other bases automatically. For example, entering 255 shows FF in hex, 11111111 in binary, and 377 in octal.

    Common questions

    Why do programmers use hexadecimal?

    Hex is compact and maps cleanly to binary, each hex digit represents exactly 4 bits. A byte (8 bits) is always two hex digits (00-FF). This makes hex much easier to read than long binary strings while remaining close to the underlying binary representation. It is used for memory addresses, color codes, and debugging.

    How do I convert hex to decimal manually?

    Multiply each hex digit by its place value (powers of 16, right to left) and add them up. For FF: F×16 + F×1 = 15×16 + 15×1 = 240 + 15 = 255. For A0: A×16 + 0×1 = 10×16 + 0 = 160.

    What is the difference between hex and octal?

    Hexadecimal uses base 16 (digits 0-F) and each digit represents 4 bits. Octal uses base 8 (digits 0-7) and each digit represents 3 bits. Hex is more commonly used today because it aligns with byte boundaries (8 bits = 2 hex digits), while octal was historically used on systems with 12, 24, or 36-bit word sizes.

    Results use standard integer arithmetic. Division shows the integer quotient and remainder; bitwise operations act on the numbers as unsigned integers.