Hex Calculator
Convert hex integers to decimal, decimal to hex, or add, subtract, multiply and divide two hex values — memory addresses and machine integers, not #RRGGBB colour strings.
How to use
- To convert: enter a hex string (FF, 1a, 0) or a decimal integer, depending on the field.
- Letters A–F work in either case.
- For arithmetic, enter two hex integers and pick an operation. Division must be exact.
- Drop the # from a colour and split channels yourself, or use the colour converter.
How it works
Hexadecimal is base 16. After 9 the digits are A–F (10–15). FF = 15×16 + 15 = 255. 10 hex is sixteen, not ten. 1A = 26. That place-value expansion is all conversion is.
Arithmetic is integer-only inside JavaScript’s safe range so the hex spelling and the decimal stay twins. A × 2 = 14 hex because 10 × 2 = 20 decimal. 5 ÷ 2 has no integer quotient; the page refuses it rather than emitting a fraction.
A leading # and six RGB digits are a colour encoding, not one integer. This is not a colour picker. Binary work belongs on the binary calculator; mixed expressions belong on the scientific calculator in decimal.
A nibble is four bits and one hex digit: 1111 is F, 1010 is A. Machine words are printed in hex so a 32-bit address stays eight characters instead of 32 bits. Signed two’s-complement reading (FF as −1 in eight bits) is not applied — every result here is an unsigned integer.
Formula
FF₁₆ = 15×16 + 15 = 255₁₀ A₁₆ × 2₁₆ = 14₁₆ (10 × 2 = 20)
Worked examples
Decimal to hex
255 → ff
Multiply two hex numbers
A × 2 → 14 (decimal 20)
Hex integers you will type often
| Hex | Decimal |
|---|---|
| A | 10 |
| 10 | 16 |
| 1A | 26 |
| 40 | 64 |
| FF | 255 |
| 100 | 256 |
Useful notes
- No #RRGGBB parsing.
- Integer division only.
- ff and FF are the same value.
FAQ
- What letters are valid in hex?
A through F, in either case. A is 10, B is 11, …, F is 15.
- How do I convert hex to decimal?
Expand by place value. 1A = 1×16 + 10 = 26.
- Can I enter a hash color like #FF8800?
No. Drop the # and treat each channel separately, or paste the hex integer without decoration.
- What is 64 decimal in hex?
40, because 4×16 + 0 = 64.
- What is 10 + 10 in hex?
20 hex (32 decimal). If you meant decimal tens, convert them first — hex 10 is sixteen.
- Is hex FF the same as eight-bit −1?
Not on this page. FF is 255. Two’s-complement signed reading is a different encoding.
Related tools
Binary Calculator
Convert between binary and decimal, or add, subtract, multiply and divide whole binary numbers.
Exponent Calculator
Raise a base to a power, including negative and fractional exponents, with overflow rejected.
Scientific Calculator
Evaluate expressions with powers, roots, logs, factorials and trigonometry in degrees or radians.
See all Math tools.