Skip to content · 跳到主要内容

Hex Calculator

Free hex calculator with a clear formula and instant result

Result
--
--
Decimal
--
Base value

Hex

Enter two base-16 integers and choose addition or subtraction. The result is shown in both the selected base and decimal.

Why hexadecimal is used

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.

Working with the result

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.

Frequently Asked Questions

Why do hex digits go up to F?

Because base 16 needs sixteen symbols. 0 to 9 cover the first ten values and A to F stand for 10 through 15.

How many hex digits make a byte?

Two. Each hex digit represents four bits, so a pair of digits covers the full eight bits of a byte.

Should I type the 0x prefix?

No. Enter the digits only; the prefix is a programming convention rather than part of the number.

Is the hexadecimal result case sensitive?

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