Skip to the calculator
Rule Calculator

Binary and hex calculator

1011 + 1101 in binary is 11000 — 11 plus 13 is 24, and the carry ran through four columns to get there. That carry is the part worth seeing: converting to decimal, adding, and converting back gives the same answer and hides the only step the question was ever about.

Arithmetic in base 2, 8, 10 or 16 with the carry column left in — because converting to decimal, doing the sum and converting back gives the right answer and hides the only part worth seeing.

Every column checked against its own arithmetic · How we check

1011 + 1101 in base 2

11000

The same answer in every base

The same answer in every base
Binary11000
Octal30
Decimal24
Hex18
Bits needed5

Column by column, with the carries

Right to left, exactly as it is done on paper — except that the carry happens at 2 rather than at ten.

Column by column, with the carries
ColumnCarried inDigitsWritesCarries
510 + 010
411 + 111
310 + 101
211 + 001
101 + 101

The carry is the whole difference

Written arithmetic is identical in every base. A column fills up, you write what is left and carry the rest — the only thing that changes is when the column fills. In binary that is at two, so 1 + 1 carries immediately and columns overflow constantly. In hex it is at sixteen, so 9 + 8 is 11 with a carry and 7 + 8 is f with none.

That is also why binary numbers are long and hex ones are short: the same value needs more columns when each column holds less. Eight bits, two hex digits and three decimal digits all describe the range 0 to 255, and the four-to-one relationship between binary and hex is why the two are used together and octal has largely fallen out of use.

Questions people actually ask

How do you add in binary?
The same way as in decimal, carrying when a column reaches the base instead of when it reaches ten. 1 + 1 is 10 — write zero, carry one — and everything else follows from that. The table above shows each column with what was carried into it and what it carried out.
Why does hex use letters?
Because base sixteen needs sixteen digits and the decimal system only supplies ten. A to F fill the gap, so f is fifteen and 10 is sixteen. The choice of letters is a convention from early computing rather than a mathematical necessity — any six symbols would do.
Why is hex used at all?
Because four binary digits fit exactly into one hex digit, so a byte is always two hex characters and a 32-bit value always eight. Converting between binary and hex is a lookup rather than an arithmetic operation, which is why memory addresses, colour codes and byte dumps are all written in it.
What about negative numbers in binary?
Computers use two’s complement: invert every bit and add one, so 8-bit −5 is 11111011. It exists so that subtraction can be performed by the addition circuit, which is why processors have no separate subtractor. This page shows plain signed arithmetic instead, because a two’s complement result depends on a word width the arithmetic itself does not have.
Why do big numbers stay exact here?
Because the arithmetic runs on arbitrary-precision integers rather than floating point. In JavaScript, 999,999,999,999,999,999,999 + 1 silently loses the last digits; here it does not. Anything past 2⁵³ is where an ordinary calculator quietly stops being right.

Sources

Related

Did this answer your question?