Hex Calculator
Hexadecimal is base 16: sixteen digits, 0–9 and A–F, where A means 10, B means 11, and so on up to F meaning 15. It is the shorthand of computing — every hex digit is exactly four binary digits, so a byte (8 bits) is two hex digits. Colour codes like #FF0000, memory addresses and cryptographic hashes are all written in hex. For converting between bytes, kilobytes and terabytes, use the data storage converter.
Hexadecimal is base 16: the digits 0–9 plus A–F, where F stands for 15 and 10 means sixteen. This calculator adds, subtracts, multiplies and divides hex numbers, shows the quotient and remainder for division, and converts between hex, decimal and binary — using exact BigInt arithmetic, so results stay exact no matter how large the numbers get.
Result
How It Works
Hex arithmetic follows the same rules as decimal arithmetic, with carrying and borrowing in sixteens instead of tens. A + 5 = F, because 10 + 5 = 15 and 15 is F in hex. FF + 1 = 100, because 255 + 1 = 256, which is 1 × 16² + 0 × 16 + 0. FF × 2 = 1FE, because 255 × 2 = 510, and 510 is 1 × 256 + 15 × 16 + 14. FF − A = F5, because 255 − 10 = 245, and 245 is 15 × 16 + 5.
Conversion is place-value arithmetic in base 16. FF = 15 × 16 + 15 = 240 + 15 = 255 in decimal, and 255 in binary is 11111111 — eight 1s, because 255 is one less than 256 (28). Going the other way, divide by 16 repeatedly and read the remainders backwards: 255 ÷ 16 = 15 remainder 15 (F), 15 ÷ 16 = 0 remainder 15 (F), giving FF.
Hex and binary convert digit by digit, because 16 = 24: each hex digit is exactly four binary digits. F is 1111, so FF is 1111 1111. That is why programmers prefer hex to binary for long numbers — it is four times shorter and just as exact.
Worked Example
Addition: A + 5 = F (10 + 5 = 15). FF + 1 = 100 (255 + 1 = 256). Multiplication: FF × 2 = 1FE (255 × 2 = 510). Subtraction: FF − A = F5 (255 − 10 = 245). Division: FF ÷ 10 = F remainder F (255 ÷ 16 = 15 remainder 15).
Conversion: hex FF = 255 in decimal = 11111111 in binary. And decimal 255 entered in the converter gives back hex FF and binary 11111111.
Assumptions
- Inputs are capped at 16 hex digits (64 bits). A hex input may have at most 16 significant digits (leading zeros do not count), and decimal or binary inputs must fit the same 64-bit range. Longer inputs are rejected with a message.
- Results are exact. All maths uses BigInt, so results are precise to the last digit — even when a result is longer than 16 hex digits, as a product of two large numbers can be.
- Output is uppercase hex without a prefix. FF, 1FE and 100 — never 0xff or ff. Inputs accept either case and an optional 0x prefix.
- Division is integer division. The quotient is the whole number of times the divisor fits, and the remainder is what is left over. The check row confirms divisor × quotient + remainder = dividend.
- Negative results use a minus sign (sign-and-magnitude), not two's complement — so A − FF shows as −F5, which is easier to read.
- Division by zero is an error — it is undefined, so the calculator says so rather than showing infinity.
Sources: No external data is used on this page — every figure is calculated from the numbers you enter, using exact BigInt hexadecimal arithmetic. Last reviewed: 15 November 2026.
Built and tested by SumKitTool — see how we check our numbers.
How to Use This Calculator
Pick hex arithmetic, enter two hex numbers using digits 0–9 and letters A–F (a 0x prefix is fine), choose the operation, and the result appears immediately in hex with its decimal and binary values alongside. Division also shows the quotient and the remainder, plus a check row.
Pick convert to switch between hex, decimal and binary: tell the calculator what your number is in, enter it, and all three forms are shown with the number of bits used. Spaces and underscores in inputs are ignored, so 0xFF_FF works the same as FFFF.
Tips and Practical Advice
Learn the two shortcuts and hex becomes quick. First, each hex digit is four binary digits: F = 1111, A = 1010, 5 = 0101 — so FF is 11111111 at a glance. Second, the place values from the right are 1, 16, 256, 4096: 1FE is 1 × 256 + 15 × 16 + 14 = 510.
Hex is everywhere in computing: #FF0000 is pure red (255 red, 0 green, 0 blue), 0xFF is the largest value a byte can hold, and memory addresses and error codes are almost always shown in hex. If a value looks like gibberish letters and digits, try it here — it may be a perfectly ordinary number in disguise.
Watch the case convention when copying results elsewhere: this calculator outputs uppercase without a prefix (FF). Programmers usually write 0xFF in code and #FF in colour codes — the same number, three notations.
Frequently Asked Questions
What is hexadecimal, and why do computers use it?
Hexadecimal is base 16, using the digits 0–9 and the letters A–F (A = 10 through F = 15). Computers use it because each hex digit is exactly four binary digits, so a byte is two hex digits — FF instead of 11111111. It is four times shorter than binary and just as exact, which is why colours, memory addresses and hashes are written in hex.
What is hex FF in decimal and binary?
Hex FF is 255 in decimal (15 × 16 + 15) and 11111111 in binary — eight 1s, because 255 is one less than 256 (2⁸). It is also the largest value a single byte can hold. Enter FF in the converter to see all three forms at once.
How do I add hex numbers like FF plus 1?
The same way as decimal addition, but carrying in sixteens: F + 1 = 10 in hex (15 + 1 = 16), so FF + 1 = 100 (255 + 1 = 256). Enter both numbers, pick Add, and the calculator shows the hex result with the decimal check alongside.
Why does the calculator output uppercase hex without a 0x prefix?
Uppercase without a prefix (FF, 1FE) is the cleanest reading form and avoids confusion with the letter O or the number 0. Inputs accept both cases and an optional 0x prefix, so 0xff, 0xFF and FF are all accepted and all mean 255.
Last updated: