Math Tools
Hex Calculator
Convert between hex, decimal, binary, and octal. Perform hexadecimal arithmetic.
Converted Value
255
Decimal (Base 10)
Math Tools
Convert between hex, decimal, binary, and octal. Perform hexadecimal arithmetic.
Converted Value
255
Decimal (Base 10)
Hexadecimal (base 16) is a numbering system using digits 0–9 and letters A–F. It's widely used in computing for memory addresses, color codes (#FF5733), and data representation. This calculator converts hex to decimal, binary, and octal, and also performs addition, subtraction, multiplication, and division on hex values without manual conversion.
The calculator offers two modes. Arithmetic mode takes two hex values and an operation (add, subtract, multiply, divide) and computes the result in all four bases. Convert mode takes a single value, lets you specify its source base, and converts it to any target base (hex, decimal, binary, octal). Results display instantly with no manual calculation needed.
Hex conversion uses positional notation: each digit position represents a power of 16. For example, FF in hex = (15 × 16¹) + (15 × 16⁰) = 240 + 15 = 255 in decimal. Arithmetic operations follow standard addition, subtraction, multiplication, and integer division rules.In hexadecimal, A=10, B=11, C=12, D=13, E=14, F=15. Each position left increases the power of 16. Arithmetic operations work the same way as decimal, but the result is expressed in whichever base you need.
| Input | Result | Notes |
|---|---|---|
| Hex: FF converted to decimal | 255 | F = 15, so (15 × 16) + 15 = 255 |
| Hex: 1A + 2B (arithmetic mode) | 45 (hex), 69 (decimal) | 26 + 43 in decimal = 69, which is 45 in hex |
| Decimal: 100 converted to hex | 64 | 100 ÷ 16 = 6 remainder 4, so hex is 64 |
Hexadecimal is used in computing for memory addresses, color codes, file encoding, and data representation. It's compact (easier than binary) yet directly maps to groups of 4 binary digits.
In hexadecimal, A=10, B=11, C=12, D=13, E=14, F=15. These letters allow us to represent 16 unique digits using 0–9 and A–F.
Yes. The calculator accepts hex values with or without the 0x prefix. Both FF and 0xFF will work.
The calculator handles numbers up to JavaScript's maximum safe integer (about 9 quadrillion). Larger values may lose precision.
This calculator converts between number bases. For RGB-to-hex color conversion, each color channel (R, G, B) is a decimal 0–255 value; convert each to hex separately and combine them (e.g. RGB 255,127,0 = #FF7F00).
Negative numbers cannot be represented as hex, binary, or octal in standard notation. Enter only non-negative values, or use decimal mode for negative number arithmetic first.