Hex Calculator Online Free Tool
Hexadecimal Calculator
Hexadecimal Operations & Conversions
Example: A5 (165) + 2F (47) = D4 (212)
Hexadecimal (base 16) uses digits 0-9 and letters A-F to represent numbers. Each hex digit corresponds to exactly 4 binary bits (a nibble), making hex an efficient shorthand for binary data. This calculator converts between hexadecimal, decimal, binary, and octal, and performs hex arithmetic.
Hexadecimal Conversion
Hex to Decimal: Multiply each digit by 16 raised to its position power FF = 15×16¹ + 15×16⁰ = 240 + 15 = 255 Decimal to Hex: Divide by 16, collect remainders 255 ÷ 16 = 15 remainder 15 (F) 15 ÷ 16 = 0 remainder 15 (F) Read remainders bottom to top: FF Hex to Binary: Replace each hex digit with 4-bit binary A = 1010, B = 1011, C = 1100 D = 1101, E = 1110, F = 1111
FF hex = 11111111 binary = 255 decimal.
Hex Color Codes
Web colors are specified as 6-digit hex codes (like #FF5733). The first two digits are red (00-FF), the middle two are green, the last two are blue. Each pair represents a value 0-255.
| Hex Color | R | G | B | Color |
|---|---|---|---|---|
| #FF0000 | 255 | 0 | 0 | Red |
| #00FF00 | 0 | 255 | 0 | Green |
| #0000FF | 0 | 0 | 255 | Blue |
| #FFFFFF | 255 | 255 | 255 | White |
| #000000 | 0 | 0 | 0 | Black |
Frequently Asked Questions
Why do programmers use hexadecimal?⌄
Hex is a compact representation of binary. Every 4 bits map to one hex digit. A byte (8 bits) is two hex digits. Memory addresses, color values, and machine code are naturally expressed in hex. 0xFF is much shorter to write than 11111111 (binary) and more readable than 255 (decimal) in contexts where the bit pattern matters.
What is 0x notation?⌄
0x is a prefix used in programming to indicate a hexadecimal number. 0xFF = 255 decimal. In assembly and some languages, the prefix is $ or #. Without a prefix, context determines whether a number is decimal or hex. The 0x convention originated in C programming and is now nearly universal in modern programming languages.
How do I add hex numbers?⌄
Add each digit column right to left, just like decimal addition, but carrying happens when the sum reaches 16 (not 10). Example: 1A + 2B. Rightmost: A+B = 10+11=21 = 15 (hex) with carry 1. Left: 1+2+1(carry) = 4. Result: 45 hex = 69 decimal. The calculator handles this automatically.
What is signed vs unsigned hex?⌄
Unsigned hex represents only positive values (0 to 2ⁿ-1 for n bits). Signed hex uses two's complement to represent negative numbers: the most significant bit is the sign bit. For 8-bit signed: 0x7F = +127, 0x80 = -128, 0xFF = -1. This is why 0xFF can mean either 255 (unsigned) or -1 (signed) depending on context.