Quick answer: 156 in binary is 10011100: dividing by 2 repeatedly leaves remainders 0, 0, 1, 1, 1, 0, 0, 1, read from the last up; check: 128 + 16 + 8 + 4 = 156.
How it's calculated
Decimal to binary: divide the number by 2, write down the remainder (0 or 1), and repeat with the quotient until it reaches 0. The remainders read from the last to the first are the binary digits.
Binary to decimal: each digit is worth a power of 2, starting from 2⁰ = 1 on the right. Add the place values of the 1s: 10011100₂ = 2⁷ + 2⁴ + 2³ + 2² = 156.
Binary arithmetic follows the same rules as decimal with carries at 2: 1 + 1 = 10₂. The calculator works with whole numbers of any length; division gives the quotient and the remainder. For base 16 use the hex calculator.
Worked examples
- Decimal to binary: 156 = 10011100₂
- Binary to decimal: 10011100₂ = 128 + 16 + 8 + 4 = 156
- Addition: 1011₂ + 110₂ = 10001₂ (11 + 6 = 17)
Powers of 2
| Power | Value | Binary |
|---|---|---|
| 2⁰ | 1 | 1 |
| 2¹ | 2 | 10 |
| 2² | 4 | 100 |
| 2³ | 8 | 1000 |
| 2⁴ | 16 | 10000 |
| 2⁸ | 256 | 100000000 |
| 2¹⁰ | 1,024 | 10000000000 |
| 2¹⁶ | 65,536 | 1 followed by 16 zeros |
Frequently asked questions
How many bits does a number need?
A whole number n ≥ 1 needs ⌊log₂ n⌋ + 1 bits: 156 needs 8 bits, 255 is the largest 8-bit number and 256 needs 9.
How are negative numbers written in binary?
This calculator shows a minus sign before the binary of the size. Computers usually store them in two's complement, which depends on the word size (8, 16, 32 or 64 bits).
Can I convert fractions such as 0.5?
Not here; the calculator handles whole numbers. In binary, 0.5 is 0.1₂ and 0.25 is 0.01₂.
What is 156 in binary?
10011100. That's 128 + 16 + 8 + 4.
What's the biggest number you can store in 8 bits?
255, which is eight ones: 11111111. With 16 bits you get up to 65,535.
How do I add binary numbers?
The same way as decimal, except you carry when you reach 2. 1011 + 110 = 10001, which is just 11 + 6 = 17.