Hex Calculator - Add, Subtract, and Convert Hexadecimal
Free online tool to add, subtract, multiply, divide, and convert hexadecimal integers. Default example: A + F = 19 hex (10 + 15 = 25). Runs in your browser.
Input Values
Letters A–F are case-insensitive. A 0x prefix and spaces are allowed. Limit is 64 hex digits. Invalid hex is rejected.
Converted Result
What Is a Hex Calculator and Why Do You Need One?
A hex calculator (hexadecimal calculator) adds, subtracts, multiplies, divides, and converts base-16 integers. Hex uses sixteen digits: 0 through 9 and A through F, where A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15. People search for how to convert hex to decimal and how to add hexadecimal numbers because those two skills cover almost every CS homework problem that is not already binary.
Hex exists because humans are bad at reading long bit strings and machines are bad at decimal. One hex digit is exactly four bits: F is 1111, A is 1010, 0 is 0000. A byte is two hex digits, a 32-bit word is eight, a 64-bit address is sixteen. That grouping is why memory dumps, CSS colors, MAC addresses, and C integer literals all use hex instead of binary or decimal.
This free online hex calculator runs entirely in your browser with JavaScript BigInt. Nothing is uploaded. A 0x prefix is optional. Letters are case-insensitive: 0xa, 0xA, and A are the same input. Invalid digits such as G are rejected instead of being guessed. The hard limit is 64 hex digits (256 bits). That is enough for IPv6-sized integers and most crypto homework prefixes; it is not unlimited precision.
The default example is A + F = 1916. In decimal that is 10 + 15 = 25, and 25 = 1×16 + 9, so the hex sum really is 19, not 15 and not AF. If your operands are already binary, use the binary calculator instead of translating every bit nibble by hand. For mixed scientific work that is not integer bases, a scientific calculator is the better sibling tool.
How to Use This Free Online Hex Calculator
Using this hexadecimal adder and converter is straightforward:
- Choose a mode. Convert shows hex, decimal, and binary for one integer. Add, Subtract, Multiply, and Divide take two hexadecimal integers.
- Enter the number(s). Hex operands may look like
A,0xFF, ordead beef(spaces are stripped). Convert mode also lets you set the from-base to 16, 10, or 2. - Read the result panel. The primary display is uppercase hex. Decimal and binary sit underneath. Divide shows quotient and remainder (truncated toward zero).
- Copy the hex string, or clear the fields. The last inputs are saved locally in your browser for up to 30 days.
Note: inputs and results are capped at 64 hex digits. Division by zero is an error. Subtracting a larger number from a smaller one yields a negative result shown with a minus sign in front of the magnitude. This is integer arithmetic only - no fractional hex, no IEEE floats, no two's-complement wrap of a fixed register width.
Hex Addition Formula - How Base-16 Arithmetic Works
To convert hex to decimal, expand each digit as a power of 16. To add, work from the right and carry 1 for every 16 in a column - the same algorithm as decimal addition, with a larger digit set.
Example - add A + F (the default):
- A = 10 decimal, F = 15 decimal
- 10 + 15 = 25 decimal
- 25 = 1×16 + 9, so the hex result is 19
- Binary check: 1010 + 1111 = 11001, and 110012 = 1916
Example - convert FF to decimal and binary:
- F×161 + F×160 = 15×16 + 15 = 255
- Each F is 1111, so FF is 11111111 binary (one byte of ones)
Example - 10 + 10 in hex is not twenty:
- Hex 10 is decimal 16, so 10 + 10 = 2016 = 3210
- Writing 20 and reading it as twenty decimal is the usual off-by-base mistake. This calculator always labels the hex result and the decimal result separately.
Hex vs Binary vs Decimal - Side-by-Side
| Value | Hex | Decimal | Binary |
|---|---|---|---|
| Ten | A | 10 | 1010 |
| Fifteen | F | 15 | 1111 |
| A + F (default) | 19 | 25 | 11001 |
| One byte of ones | FF | 255 | 11111111 |
Hex is a shorthand for binary, not a rival number system with different arithmetic. A + F in hex must match 1010 + 1111 in binary and 10 + 15 in decimal. If those three views disagree, a digit was misread. Convert mode on this page is there so you can catch that mismatch before you paste an address into a debugger.
Where Hexadecimal Shows Up in Real Work
1. Memory addresses and pointers
Debuggers print addresses as hex because a 64-bit pointer is sixteen hex digits, not sixty-four bits. Adding an offset to a base address is ordinary hex addition. This calculator will add those integers; it will not know your process layout, and it will not dereference anything.
2. RGB colors and web design
#FF0000 is red because FF is 255 in the red channel. Adding color channels in hex is possible here, but clamping to 00– FF is your job - this tool will happily report 1FE if you add FF + FF, which is not a valid 8-bit channel.
3. Machine-code dumps and checksums
Object dumps, USB descriptors, and simple checksums are streams of hex bytes. You can convert a byte to binary to inspect flags, or add a short list of bytes. You cannot parse ELF files or compute CRC polynomials on this page.
4. What this tool will not do
It does not evaluate C expressions, does not understand typed literals like ULL, and does not wrap at 8, 16, 32, or 64 bits unless the mathematical result happens to fit. If you need a fixed-width two's-complement modulo, apply that modulus yourself after you read the unlimited-magnitude hex result - or stay inside 64 hex digits, which is the published cap.
Related Mistakes When Converting or Adding Hexadecimal
The classic error is treating A + F as 15 because F looks like the "last" digit. F is 15, A is 10, and the sum is 25 decimal / 19 hex. Another error is assuming hex is case-sensitive. It is not: a and A are the same digit. This calculator accepts mixed case and prints uppercase so A–F do not look like 0–9 in a bad font.
A 0x prefix is decoration, not a multiply-by-something. 0x10 is sixteen, not "zero x ten." Putting 0b on a hex operand is invalid here; switch Convert to from-base 2 if the source is binary. G, H, and I are not hex digits - if a datasheet printed them, it was not hexadecimal.
People also confuse hex 10 with decimal 10. Hex 10 is 16. Hex 100 is 256. That power-of-sixteen pattern is the whole point of the notation, and it is the reason a two-digit color channel tops out at FF (255), not 99.
How to Multiply and Divide Hexadecimal Numbers
Hex multiplication is decimal multiplication with a different digit set. A × 2 = 1416 because 10×2 = 20 decimal = 1×16 + 4. F × F = E116 because 15×15 = 225 decimal = 14×16 + 1. This calculator uses BigInt so you do not have to keep a 16-by-16 times table in your head, but the place-value story is the same as the addition example A + F = 19.
Hex division, like binary division, is integer quotient plus remainder. FF ÷ 1016 is 255 ÷ 16, so the quotient is F and the remainder is F: 15×16 + 15 = 255. Division by zero is an error. Remainders are not hex fractions; 10 ÷ 3 is quotient 5 remainder 1 in decimal, which in hex is still quotient 5 remainder 1 because both 5 and 1 are the same glyphs in both bases.
Subtracting a larger hex integer from a smaller one produces a negative magnitude with a leading minus, not a wrap at 8 or 32 bits. If you needed (A − F) mod 10016 for a two-digit color channel, that modular wrap is your extra step. The published cap is 64 hex digits - 256 bits - which is enough for a UUID-sized integer and not enough for a 2048-bit RSA modulus printed in full.
Nibbles, Bytes, and Why One Hex Digit Is Four Bits
A nibble is four bits, and that is exactly one hex digit. That is the only reason hex beat octal in modern software. You can convert hex to binary by expanding each digit independently: A = 1010, F = 1111, so AF = 10101111. You cannot convert decimal to binary that way, because ten is not a power of two. Convert mode on this page will still do decimal ↔ hex ↔ binary for you; the nibble rule is why the binary column is easy to check by eye for hex input and hard to check for decimal input.
CSS colors, MAC addresses, and IPv6 pieces are hex because of this grouping, not because the underlying arithmetic is exotic. Adding two color channels can legally exceed FF; this tool will report 1FE for FF + FF and will not clamp. Memory addresses in a 64-bit process are up to sixteen hex digits. A 0x prefix does not change the value. Case does not change the value. G is never a hex digit.
If your homework is already in 0s and 1s, skip the nibble translation and use the binary calculator. If you need trig or a full expression line rather than integer bases, use a scientific calculator. This page stays honest: it is an integer hex tool with a 64-digit cap, not a debugger and not a color picker. People also search “convert hex to decimal” for values like 0xFF and “add hexadecimal numbers” for A + F; both are on this page, and both stay in the browser. Privacy is the same story as every other DevOkk math tool: after the script loads, a dropped network does not stop A + F from remaining 19 hex.
Frequently Asked Questions (FAQ) - Hex Calculator
How do I convert hex to decimal?
Each hex digit is a power of 16. Reading A from the right: A is 10, so A × 16^0 = 10. FF is 15×16 + 15 = 255. Choose Convert, set the from-base to 16, and paste the hex string (0x is optional). The result panel also shows binary.
How do I add hexadecimal numbers?
Add digits from the right, carrying when a column meets or exceeds 16. A + F is 10 + 15 = 25 decimal, which is 19 in hex (1×16 + 9). This calculator uses BigInt so you do not have to track the carry by hand.
What is the difference between hex and binary?
Binary is base 2 (digits 0 and 1). Hex is base 16 (digits 0–9 and A–F). One hex digit is exactly four bits: F is 1111 and A is 1010. Programmers use hex because a 32-bit word is eight hex digits instead of 32 bits.
Is hexadecimal case sensitive?
No. A and a are the same digit (value 10). This calculator accepts mixed case. The result is shown in uppercase so A–F are easy to distinguish from 0–9.
Can I use a 0x prefix?
Yes. 0xA, 0XA, and A are the same input. Spaces are stripped. Do not mix a 0b prefix into hex mode; use Convert with from-base 2 if the source is binary.
Does this calculator upload my numbers?
No. Conversion and arithmetic run in your browser with JavaScript. Nothing is sent to a server. After the page loads, the tool still works if the network drops.
Why Choose Our Hex Calculator?
- Free, no account. Unlimited conversions and sums.
- Private. All BigInt math stays in the browser.
- Add, subtract, multiply, divide with quotient and remainder.
- Convert hex, decimal, and binary in one panel.
- 0x prefix and mixed-case A–F accepted; invalid digits rejected.
- 64 hex-digit cap so a pasted dump cannot hang the tab.
- Works offline after the first page load.
Related Tools
Discover more free developer tools that might interest you.
Area Calculator
Calculate area of squares, rectangles, triangles, circles, and more
Use ToolAverage Calculator
Calculate mean, median, mode, and range from a list of numbers
Use ToolBasic Calculator
Add, subtract, multiply, and divide with a free online calculator
Use ToolBig Number Calculator
Add, subtract, multiply, and divide integers too large for a standard calculator
Use ToolBinary Calculator
Add, subtract, and convert binary numbers to decimal and hex
Use ToolCircle Calculator
Find radius, diameter, circumference, area, arc length, and sector area
Use Tool