Hex Calculator
Free hex calculator with a clear formula and instant result
Free hex calculator with a clear formula and instant result
Enter two base-16 integers and choose addition or subtraction. The result is shown in both the selected base and decimal.
One hexadecimal digit maps to exactly four binary bits, so a byte is written with two hex characters. That makes hex far more compact than binary while staying readable, which is why colour codes, memory addresses, byte dumps and network masks use base 16. The digits run 0 to 9 and then A to F for the values 10 to 15.
Addition and subtraction behave as in decimal, carrying when a column reaches 16. Converting a result to decimal confirms the arithmetic, and converting it back to hex is the usual next step before pasting it into a colour picker, a debugger or a configuration file. Prefixes such as 0x are not entered here; supply the digits only.
输入两个 16 进制整数并选择加法或减法,结果同时显示进制形式和十进制。
一位十六进制正好对应四位二进制,因此一个字节正好写成两个十六进制字符。这使十六进制比二进制紧凑得多又保持可读,所以颜色码、内存地址、字节转储与网络掩码都用 16 进制书写。数字从 0 到 9,再用 A 到 F 表示 10 到 15。
加减法与十进制同理,只是某一位达到 16 时进位。把结果转成十进制有助于核对运算,而需要粘进取色器、调试器或配置文件时,通常再转回十六进制。本工具无需输入 0x 之类前缀,只填数字即可。
Because base 16 needs sixteen symbols. 0 to 9 cover the first ten values and A to F stand for 10 through 15.
Two. Each hex digit represents four bits, so a pair of digits covers the full eight bits of a byte.
No. Enter the digits only; the prefix is a programming convention rather than part of the number.
No. A to F and a to f mean the same values, though uppercase is conventional for colour codes.
Last reviewed: October 5, 2026 · How we calculate · Sources: Published formula reference; verify domain-specific assumptions before making a decision
最近复核:2026 年 10 月 5 日 · 我们的计算方法 · 来源:公式用于参考;涉及专业决定时请核对适用条件