Hex Calculator
Enter two whole numbers in the base you choose and pick an operation. The answer is shown in hexadecimal, decimal, binary and octal.
Result
- Binary
- 1101011110110
- Octal
- 15366
- First number in decimal
- 6719
- Second number in decimal
- 183
Formula
- Hex digits: 0 to 9 and A to F, where A = 10 and F = 15
- Carry in hex addition when a column reaches 16
- AND gives 1 where both bits are 1, OR where either is 1, XOR where exactly one is 1
How the Hex Calculator works
Hexadecimal arithmetic works like decimal arithmetic, except each column counts to 15 before carrying. Adding F and 1 gives 10 in hex, which is 16 in decimal.
Bitwise operations compare two numbers bit by bit. They are used to set, clear and test individual flags in programming, and XOR is the basis of many checksums and simple ciphers.
Worked example
1A3F + B7 in hex: 1A3F is 6,719 and B7 is 183 in decimal. Their sum is 6,902, which is 1AF6 in hexadecimal.
Frequently asked questions
How do I add hexadecimal numbers by hand?
Add column by column from the right. If a column totals 16 or more, subtract 16, write the remainder and carry 1 to the next column.
What is FF in decimal?
FF is 15 × 16 + 15 = 255, the largest value of one byte.
Related calculators
- Hex Translator: Text to HexadecimalConvert text to hexadecimal bytes and hex back to text using UTF-8. Useful for reading hex dumps and encoding strings.
- Binary Translator: Text to BinaryConvert text to binary code and binary back to text. Uses 8-bit bytes with UTF-8, so it handles ASCII and every other character.
- IEEE 754 Floating Point ConverterConvert a decimal number to its IEEE 754 single and double precision representation: sign, exponent and mantissa bits, hex value and the exact stored number.
- Chmod CalculatorBuild Unix file permissions by ticking read, write and execute for owner, group and others. Get the octal number, symbolic notation and chmod command.
- Morse Code TranslatorTranslate text to Morse code and Morse code back to text. Supports letters, numbers and punctuation in International Morse Code.
- Base64 Encoder and DecoderEncode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe variant.
- Text to ASCII and Unicode ConverterConvert text to ASCII codes and Unicode code points in decimal and hex, or turn a list of character codes back into text.
- Caesar Cipher Encoder and SolverEncrypt or decrypt text with a Caesar shift cipher. Shows all 25 possible shifts so you can solve a cipher without knowing the key, including ROT13.
- Letter to Number Converter (A1Z26)Convert letters to their alphabet position numbers, where A is 1 and Z is 26, or convert numbers back to letters.
- Subnet CalculatorCalculate the network address, broadcast address, host range, subnet mask and number of hosts for any IPv4 address and CIDR prefix.
Related unit converters
Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.