SciCalc.net
IndiaFree tools

Hex calculator (hexadecimal)

Type a hex number or calculation, such as FF + 1 or 1F × A. Results are shown in hex, decimal, binary and octal.

Last updated

Decimal256
Hex100
Octal400
Binary0000 0000 0000 0000 0000 0001 0000 0000

Working

    Try:

    How it works

    Hexadecimal is base 16, using the digits 0–9 and A–F (A = 10 … F = 15). Each hex digit is exactly four binary digits, which is why hex is used for memory addresses and colours.

    1F₁₆ = 1 × 16 + 15 = 31

    Negative numbers use two’s complement in the chosen word size, so FF read as an 8-bit number is −1.

    Worked example

    Work out 1F × A. 1F₁₆ = 31 and A₁₆ = 10, so the product is 310 = 136₁₆. FF + 1 = 255 + 1 = 256 = 100₁₆.

    How do you convert hex to decimal by place value?

    Each place in a hex number is worth 16 times the place to its right. Multiply each digit by its place value and add.

    PlacePower of 16Value
    1st from the right1601
    2nd16116
    3rd162256
    4th1634,096
    5th16465,536

    Example: 4A016 = 4 × 256 + 10 × 16 + 0 × 1 = 1184. A web color works the same way, one byte at a time: #1E3FD0 is 1E = 16 + 14 = 30, 3F = 3 × 16 + 15 = 63 and D0 = 13 × 16 = 208, so the color is RGB(30, 63, 208).

    Adding with a carry and subtracting with a borrow

    Work from the right, as in decimal, but carry or borrow 16 instead of 10.

    2A3 + 1FD: in the right column, 3 + D = 3 + 13 = 16, which is 1016, so write 0 and carry 1. In the middle column, A + F + 1 = 10 + 15 + 1 = 26, which is 1A16, so write A and carry 1. In the left column, 2 + 1 + 1 = 4. The answer is 4A0, and the decimal check is 675 + 509 = 1184.

    ABC − 2F: in the right column, C (12) is smaller than F (15), so borrow 16 from the B: 12 + 16 − 15 = 13 = D. The B is now worth one less, so the middle column is 11 − 1 − 2 = 8. The A comes down unchanged. The answer is A8D, and in decimal 2748 − 47 = 2701.

    Why does the word size change the answer?

    The calculator reads a typed hex number as a two's complement bit pattern in the word size you pick. That matters most for multiplication. Try FF × FF:

    • 32-bit: FF is 255, and 255 × 255 = 65025 = FE0116.
    • 16-bit: FF is still 255, but 65025 is larger than 32,767, the biggest signed 16-bit value, so the calculator reports that the result is out of range.
    • 8-bit: FF is read as −1, so the product is (−1) × (−1) = 1.

    Common mistakes

    • Typing a prefix or suffix. Enter the digits only: the calculator does not accept 0x in front or h after the number.
    • Reading 80 as 128 in 8-bit. Its top bit is set, so the signed value is 128 − 256 = −128.
    • Expecting a remainder from division. Division keeps the whole-number part and rounds toward zero, so in decimal terms 7 ÷ 2 gives 3 and −7 ÷ 2 gives −3.
    • Forgetting the borrow when one column turns out smaller. The next column to the left must lose 1.

    Tips

    • Letters can be typed in upper or lower case.
    • Pick a word size large enough for your numbers; FF is −1 in 8-bit but 255 in 16-bit.
    • Web colours like #1E3FD0 are three hex bytes: 1E, 3F, D0.

    Questions

    What is FF in decimal?

    255 (or −1 as a signed 8-bit number).

    How do I convert hex to binary?

    Replace each hex digit with its four bits: A = 1010, so 3A = 0011 1010.

    Why does division drop the remainder?

    Hex mode works with whole numbers, as on handheld calculators. Use the modulo calculator for the remainder.

    Can I type 0x in front of a hex number?

    No. Type the hex digits only, such as 1F. The calculator rejects the 0x prefix and the h suffix.

    What is 7FFFFFFF in decimal?

    2,147,483,647. It is 2³¹ − 1, the largest signed 32-bit number.

    Why does FF × FF give 1 in 8-bit?

    In an 8-bit word, the pattern FF is two's complement for −1, and (−1) × (−1) = 1. Choose 32-bit to get 255 × 255 = 65025 (FE01).

    Sources

    1. Casio fx-115ES PLUS / fx-991ES PLUS C (2nd edition) user's guide, support.casio.com: Base-n Calculations (BASE-N). DEC, HEX, BIN and OCT; and, or, xor, xnor and Not; negative values use two's complement; fractional parts are cut off. Checked 22 November 2026.