Hex Calculator
Perform hexadecimal arithmetic
Frequently Asked Questions
How do I convert between hexadecimal and decimal?
Hex uses digits 0-9 and A-F (A=10, B=11, ..., F=15). To convert hex to decimal, multiply each digit by 16^position. For example, 2F = 2×16 + 15 = 47. The calculator handles conversions in both directions instantly.
Can I perform arithmetic with hexadecimal numbers?
Yes. The calculator supports addition, subtraction, multiplication, and division of hex values. Results are shown in both hex and decimal. For example, 0xFF + 0x01 = 0x100 (255 + 1 = 256 in decimal).
Why is hexadecimal used in programming?
Hex is compact — each hex digit represents exactly 4 binary bits. A byte (8 bits) is two hex digits: 0x00 to 0xFF. This makes hex ideal for memory addresses, color codes (#FF0000), and binary data representation.
How do hex color codes work?
CSS hex colors use 6 hex digits: #RRGGBB. Each pair ranges from 00 (0) to FF (255). #FF0000 is pure red, #00FF00 is green, #0000FF is blue. #808080 is medium gray (128,128,128).
What is the difference between hex, octal, and binary?
Binary is base-2 (0,1), octal is base-8 (0-7), hex is base-16 (0-F). The decimal number 255 is 11111111 in binary, 377 in octal, and FF in hex. Hex is most common in programming due to its compact representation of bytes.