StringMash.com

Binary to decimal converter

Binary numbers to decimal, with the place values shown.

Conversion
8 characters
Updates as you type
Swap for decimal to binary

Show the steps
  1. 1 × 2⁷ = 1 × 128 = 128
  2. 0 × 2⁶ = 0 × 64 = 0
  3. 0 × 2⁵ = 0 × 32 = 0
  4. 1 × 2⁴ = 1 × 16 = 16
  5. 1 × 2³ = 1 × 8 = 8
  6. 1 × 2² = 1 × 4 = 4
  7. 0 × 2¹ = 0 × 2 = 0
  8. 0 × 2⁰ = 0 × 1 = 0
  9. Add them up: 128 + 16 + 8 + 4 = 156
Printable chart

Using the converter

Type a binary number, made of 0s and 1s, and its decimal value appears as you type. Several numbers can go in at once, separated by spaces, commas or new lines. Prefixes like 0x and 0b are fine, and so is the _ character used to group digits, as in 1001_1100. Numbers can be as long as you like and can be negative, but they have to be whole: there's no decimal point.

This converts numbers. To turn binary back into letters and words, use the binary translator instead.

Show the steps opens the working under the answer, line by line, the same way you'd set it out on paper. It shows the first four numbers when there are several.

How to convert binary to decimal

Write the place values over the bits, starting from 1 on the right and doubling each time: 1, 2, 4, 8, 16, 32, 64, 128. Add up the place values that have a 1 under them and skip the ones with a 0.

For 10011100 the 1s sit under 128, 16, 8 and 4. 128 + 16 + 8 + 4 is 156.

File permissions in octal

Unix file permissions are three bits each, one bit for read, one for write and one for execute, which is why they're written in octal. Read is worth 4, write 2 and execute 1, and each octal digit adds up one set, for the file's owner, its group and everyone else in turn. A mode of 754 gives the owner 4 + 2 + 1, everything, the group 4 + 1, read and execute, and everyone else 4, read only.

THE FIRST 33 NUMBERS

Decimal, binary, octal and hex from 0 to 32

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010
17100012111
18100102212
19100112313
20101002414
21101012515
22101102616
23101112717
24110003018
25110013119
2611010321A
2711011331B
2811100341C
2911101351D
3011110361E
3111111371F
321000004020

Questions

What is 11111111 in decimal?

255, which is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1. It's the largest number a byte can hold.

Why is binary used in computers?

Each bit only has to be one of two states, on or off, which is simple to build reliably in electronics.

Does it handle spaces between groups of bits?

A space starts a new number, so 1001 1100 is read as two numbers. To group the bits of one number, join the groups with _ instead, as in 1001_1100.