0 in Binary
Zero is written as a single 0.
Two digits, 0 and 1, count powers of two. Decimal 42 becomes 101010 in binary.
Convert numbers42 · Base 2
101010: 32 + 8 + 2 = 42.
Read from left to right. The rightmost place counts ones; each place to its left is worth 2 times as much.
42 ÷ 32 = 1, remainder 10. Start with 1 in the 32s place, then write the remainder in the lower places.
This sign is the digit 1. In the 32s place, it contributes 1 × 32 = 32.
This sign is the digit 0. Keep zero in the 16s place; this position contributes nothing.
10 ÷ 8 = 1, remainder 2. This sign is the digit 1. In the 8s place, it contributes 1 × 8 = 8.
This sign is the digit 0. Keep zero in the 4s place; this position contributes nothing.
2 ÷ 2 = 1, remainder 0. This sign is the digit 1. In the 2s place, it contributes 1 × 2 = 2.
This sign is the digit 0. Keep zero in the ones place; this position contributes nothing.
Check
1 × 32 + 0 × 16 + 1 × 8 + 0 × 4 + 1 × 2 + 0 = 42
Each tile shows one digit and its value. These are the 2 digits used by this display. Combine them using the rules below.
Read from left to right, using only 0 and 1. From the right, the places are worth 1, 2, 4, 8, 16, 32, and so on. Add the places that contain a 1.
Zero is written as a single 0.
10: one two and zero ones.
101010: 32 + 8 + 2 = 42.
NASA’s example: 10110101 = 128 + 32 + 16 + 4 + 1.
11111111: eight 1 bits add up to 255.
Enter a nonnegative whole number in decimal. Output uses at most 256 binary digits and omits the optional 0b prefix and leading zeros. Signed, fractional, and fixed-width machine encodings are outside this converter.
Leibniz described arithmetic with only 0 and 1 in a 1703 account. Binary place value later became central to digital computing, where each bit has two possible values. This entry presents the modern computing notation rather than assigning binary a single place or date of invention.
Read from left to right, using only 0 and 1. From the right, the places are worth 1, 2, 4, 8, 16, 32, and so on. Add the places that contain a 1.
Enter a nonnegative whole number in decimal. Output uses at most 256 binary digits and omits the optional 0b prefix and leading zeros. Signed, fractional, and fixed-width machine encodings are outside this converter.
Compare systems