Type in any field and the other three update. Spaces, underscores and the prefixes 0b, 0x and 0o are ignored. Fractions such as 101.101 work too; digits in brackets repeat forever, so 0.0(0011) means 0.000110011… in binary.
Binary to decimal chart (0 to 255)
Every value that fits in one byte, with its 8-bit binary pattern and two-digit hex code. The binary column is split into two groups of four bits, and each group of four is exactly one hex digit, so you can check both columns against each other.
| Dec | Binary | Hex |
|---|---|---|
| 0 | 0000 0000 | 00 |
| 1 | 0000 0001 | 01 |
| 2 | 0000 0010 | 02 |
| 3 | 0000 0011 | 03 |
| 4 | 0000 0100 | 04 |
| 5 | 0000 0101 | 05 |
| 6 | 0000 0110 | 06 |
| 7 | 0000 0111 | 07 |
| 8 | 0000 1000 | 08 |
| 9 | 0000 1001 | 09 |
| 10 | 0000 1010 | 0A |
| 11 | 0000 1011 | 0B |
| 12 | 0000 1100 | 0C |
| 13 | 0000 1101 | 0D |
| 14 | 0000 1110 | 0E |
| 15 | 0000 1111 | 0F |
| 16 | 0001 0000 | 10 |
| 17 | 0001 0001 | 11 |
| 18 | 0001 0010 | 12 |
| 19 | 0001 0011 | 13 |
| 20 | 0001 0100 | 14 |
| 21 | 0001 0101 | 15 |
| 22 | 0001 0110 | 16 |
| 23 | 0001 0111 | 17 |
| 24 | 0001 1000 | 18 |
| 25 | 0001 1001 | 19 |
| 26 | 0001 1010 | 1A |
| 27 | 0001 1011 | 1B |
| 28 | 0001 1100 | 1C |
| 29 | 0001 1101 | 1D |
| 30 | 0001 1110 | 1E |
| 31 | 0001 1111 | 1F |
| 32 | 0010 0000 | 20 |
| 33 | 0010 0001 | 21 |
| 34 | 0010 0010 | 22 |
| 35 | 0010 0011 | 23 |
| 36 | 0010 0100 | 24 |
| 37 | 0010 0101 | 25 |
| 38 | 0010 0110 | 26 |
| 39 | 0010 0111 | 27 |
| 40 | 0010 1000 | 28 |
| 41 | 0010 1001 | 29 |
| 42 | 0010 1010 | 2A |
| 43 | 0010 1011 | 2B |
| 44 | 0010 1100 | 2C |
| 45 | 0010 1101 | 2D |
| 46 | 0010 1110 | 2E |
| 47 | 0010 1111 | 2F |
| 48 | 0011 0000 | 30 |
| 49 | 0011 0001 | 31 |
| 50 | 0011 0010 | 32 |
| 51 | 0011 0011 | 33 |
| 52 | 0011 0100 | 34 |
| 53 | 0011 0101 | 35 |
| 54 | 0011 0110 | 36 |
| 55 | 0011 0111 | 37 |
| 56 | 0011 1000 | 38 |
| 57 | 0011 1001 | 39 |
| 58 | 0011 1010 | 3A |
| 59 | 0011 1011 | 3B |
| 60 | 0011 1100 | 3C |
| 61 | 0011 1101 | 3D |
| 62 | 0011 1110 | 3E |
| 63 | 0011 1111 | 3F |
| Dec | Binary | Hex |
|---|---|---|
| 64 | 0100 0000 | 40 |
| 65 | 0100 0001 | 41 |
| 66 | 0100 0010 | 42 |
| 67 | 0100 0011 | 43 |
| 68 | 0100 0100 | 44 |
| 69 | 0100 0101 | 45 |
| 70 | 0100 0110 | 46 |
| 71 | 0100 0111 | 47 |
| 72 | 0100 1000 | 48 |
| 73 | 0100 1001 | 49 |
| 74 | 0100 1010 | 4A |
| 75 | 0100 1011 | 4B |
| 76 | 0100 1100 | 4C |
| 77 | 0100 1101 | 4D |
| 78 | 0100 1110 | 4E |
| 79 | 0100 1111 | 4F |
| 80 | 0101 0000 | 50 |
| 81 | 0101 0001 | 51 |
| 82 | 0101 0010 | 52 |
| 83 | 0101 0011 | 53 |
| 84 | 0101 0100 | 54 |
| 85 | 0101 0101 | 55 |
| 86 | 0101 0110 | 56 |
| 87 | 0101 0111 | 57 |
| 88 | 0101 1000 | 58 |
| 89 | 0101 1001 | 59 |
| 90 | 0101 1010 | 5A |
| 91 | 0101 1011 | 5B |
| 92 | 0101 1100 | 5C |
| 93 | 0101 1101 | 5D |
| 94 | 0101 1110 | 5E |
| 95 | 0101 1111 | 5F |
| 96 | 0110 0000 | 60 |
| 97 | 0110 0001 | 61 |
| 98 | 0110 0010 | 62 |
| 99 | 0110 0011 | 63 |
| 100 | 0110 0100 | 64 |
| 101 | 0110 0101 | 65 |
| 102 | 0110 0110 | 66 |
| 103 | 0110 0111 | 67 |
| 104 | 0110 1000 | 68 |
| 105 | 0110 1001 | 69 |
| 106 | 0110 1010 | 6A |
| 107 | 0110 1011 | 6B |
| 108 | 0110 1100 | 6C |
| 109 | 0110 1101 | 6D |
| 110 | 0110 1110 | 6E |
| 111 | 0110 1111 | 6F |
| 112 | 0111 0000 | 70 |
| 113 | 0111 0001 | 71 |
| 114 | 0111 0010 | 72 |
| 115 | 0111 0011 | 73 |
| 116 | 0111 0100 | 74 |
| 117 | 0111 0101 | 75 |
| 118 | 0111 0110 | 76 |
| 119 | 0111 0111 | 77 |
| 120 | 0111 1000 | 78 |
| 121 | 0111 1001 | 79 |
| 122 | 0111 1010 | 7A |
| 123 | 0111 1011 | 7B |
| 124 | 0111 1100 | 7C |
| 125 | 0111 1101 | 7D |
| 126 | 0111 1110 | 7E |
| 127 | 0111 1111 | 7F |
| Dec | Binary | Hex |
|---|---|---|
| 128 | 1000 0000 | 80 |
| 129 | 1000 0001 | 81 |
| 130 | 1000 0010 | 82 |
| 131 | 1000 0011 | 83 |
| 132 | 1000 0100 | 84 |
| 133 | 1000 0101 | 85 |
| 134 | 1000 0110 | 86 |
| 135 | 1000 0111 | 87 |
| 136 | 1000 1000 | 88 |
| 137 | 1000 1001 | 89 |
| 138 | 1000 1010 | 8A |
| 139 | 1000 1011 | 8B |
| 140 | 1000 1100 | 8C |
| 141 | 1000 1101 | 8D |
| 142 | 1000 1110 | 8E |
| 143 | 1000 1111 | 8F |
| 144 | 1001 0000 | 90 |
| 145 | 1001 0001 | 91 |
| 146 | 1001 0010 | 92 |
| 147 | 1001 0011 | 93 |
| 148 | 1001 0100 | 94 |
| 149 | 1001 0101 | 95 |
| 150 | 1001 0110 | 96 |
| 151 | 1001 0111 | 97 |
| 152 | 1001 1000 | 98 |
| 153 | 1001 1001 | 99 |
| 154 | 1001 1010 | 9A |
| 155 | 1001 1011 | 9B |
| 156 | 1001 1100 | 9C |
| 157 | 1001 1101 | 9D |
| 158 | 1001 1110 | 9E |
| 159 | 1001 1111 | 9F |
| 160 | 1010 0000 | A0 |
| 161 | 1010 0001 | A1 |
| 162 | 1010 0010 | A2 |
| 163 | 1010 0011 | A3 |
| 164 | 1010 0100 | A4 |
| 165 | 1010 0101 | A5 |
| 166 | 1010 0110 | A6 |
| 167 | 1010 0111 | A7 |
| 168 | 1010 1000 | A8 |
| 169 | 1010 1001 | A9 |
| 170 | 1010 1010 | AA |
| 171 | 1010 1011 | AB |
| 172 | 1010 1100 | AC |
| 173 | 1010 1101 | AD |
| 174 | 1010 1110 | AE |
| 175 | 1010 1111 | AF |
| 176 | 1011 0000 | B0 |
| 177 | 1011 0001 | B1 |
| 178 | 1011 0010 | B2 |
| 179 | 1011 0011 | B3 |
| 180 | 1011 0100 | B4 |
| 181 | 1011 0101 | B5 |
| 182 | 1011 0110 | B6 |
| 183 | 1011 0111 | B7 |
| 184 | 1011 1000 | B8 |
| 185 | 1011 1001 | B9 |
| 186 | 1011 1010 | BA |
| 187 | 1011 1011 | BB |
| 188 | 1011 1100 | BC |
| 189 | 1011 1101 | BD |
| 190 | 1011 1110 | BE |
| 191 | 1011 1111 | BF |
| Dec | Binary | Hex |
|---|---|---|
| 192 | 1100 0000 | C0 |
| 193 | 1100 0001 | C1 |
| 194 | 1100 0010 | C2 |
| 195 | 1100 0011 | C3 |
| 196 | 1100 0100 | C4 |
| 197 | 1100 0101 | C5 |
| 198 | 1100 0110 | C6 |
| 199 | 1100 0111 | C7 |
| 200 | 1100 1000 | C8 |
| 201 | 1100 1001 | C9 |
| 202 | 1100 1010 | CA |
| 203 | 1100 1011 | CB |
| 204 | 1100 1100 | CC |
| 205 | 1100 1101 | CD |
| 206 | 1100 1110 | CE |
| 207 | 1100 1111 | CF |
| 208 | 1101 0000 | D0 |
| 209 | 1101 0001 | D1 |
| 210 | 1101 0010 | D2 |
| 211 | 1101 0011 | D3 |
| 212 | 1101 0100 | D4 |
| 213 | 1101 0101 | D5 |
| 214 | 1101 0110 | D6 |
| 215 | 1101 0111 | D7 |
| 216 | 1101 1000 | D8 |
| 217 | 1101 1001 | D9 |
| 218 | 1101 1010 | DA |
| 219 | 1101 1011 | DB |
| 220 | 1101 1100 | DC |
| 221 | 1101 1101 | DD |
| 222 | 1101 1110 | DE |
| 223 | 1101 1111 | DF |
| 224 | 1110 0000 | E0 |
| 225 | 1110 0001 | E1 |
| 226 | 1110 0010 | E2 |
| 227 | 1110 0011 | E3 |
| 228 | 1110 0100 | E4 |
| 229 | 1110 0101 | E5 |
| 230 | 1110 0110 | E6 |
| 231 | 1110 0111 | E7 |
| 232 | 1110 1000 | E8 |
| 233 | 1110 1001 | E9 |
| 234 | 1110 1010 | EA |
| 235 | 1110 1011 | EB |
| 236 | 1110 1100 | EC |
| 237 | 1110 1101 | ED |
| 238 | 1110 1110 | EE |
| 239 | 1110 1111 | EF |
| 240 | 1111 0000 | F0 |
| 241 | 1111 0001 | F1 |
| 242 | 1111 0010 | F2 |
| 243 | 1111 0011 | F3 |
| 244 | 1111 0100 | F4 |
| 245 | 1111 0101 | F5 |
| 246 | 1111 0110 | F6 |
| 247 | 1111 0111 | F7 |
| 248 | 1111 1000 | F8 |
| 249 | 1111 1001 | F9 |
| 250 | 1111 1010 | FA |
| 251 | 1111 1011 | FB |
| 252 | 1111 1100 | FC |
| 253 | 1111 1101 | FD |
| 254 | 1111 1110 | FE |
| 255 | 1111 1111 | FF |
Signed integer ranges (two’s complement)
| Width | Signed minimum | Signed maximum | Unsigned maximum |
|---|---|---|---|
| 8−bit | −128 | 127 | 255 |
| 16−bit | −32,768 | 32,767 | 65,535 |
| 32−bit | −2,147,483,648 | 2,147,483,647 | 4,294,967,295 |
| 64−bit | −9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 | 18,446,744,073,709,551,615 |
Source: thealltools.com/tools/binary-to-decimal
About this tool
This converter turns binary numbers into decimal and decimal numbers into binary, with hexadecimal and octal kept in step. All four fields are editable, the arithmetic uses JavaScript BigInt so a 200-digit binary number converts exactly, and a show-work panel writes out the same steps you would do on paper. It converts numbers. If you want to turn letters into their binary or hex byte codes (the word “Hi” into 01001000 01101001), use the Text to Binary converter instead; it encodes text as UTF-8 bytes, which is a different job.
How to use the binary to decimal converter
- Type or paste a binary number into the Binary field. Spaces and underscores between digit groups are fine, and so is a
0bprefix. - Read the result in the Decimal field. Hex and octal update at the same time.
- To go from decimal to binary, type in the Decimal field instead. A leading minus sign gives a negative result such as
-101010. - Pick a width (8, 16, 32 or 64 bits) to see the two’s complement pattern, or to read your bits as a signed number.
- Open the show-work panel to copy the steps into homework or notes.
Positional notation: why binary works
Every digit in a number is worth its own value times a power of the base. In decimal the places are ones, tens, hundreds and so on (100, 101, 102). Binary uses the same idea with base 2, so the places from the right are worth 1, 2, 4, 8, 16, 32, 64, 128 and onward, doubling each time. Because each binary digit (a bit) is only ever 0 or 1, a place is either counted or skipped. To the right of the binary point the places keep halving: 1/2, 1/4, 1/8, which is why 101.101 is 4 + 1 + 0.5 + 0.125 = 5.625.
Worked example: 11010110 to decimal and back
The tool loads with 11010110. Number the places from the right starting at 0. The 1 bits sit in places 7, 6, 4, 2 and 1, so the value is 27 + 26 + 24 + 22 + 21 = 128 + 64 + 16 + 4 + 2 = 214. The same number is D6 in hex and 326 in octal.
To convert 214 from decimal to binary, divide by 2 again and again and write down each remainder:
| Step | Quotient | Remainder |
|---|---|---|
| 214 ÷ 2 | 107 | 0 |
| 107 ÷ 2 | 53 | 1 |
| 53 ÷ 2 | 26 | 1 |
| 26 ÷ 2 | 13 | 0 |
| 13 ÷ 2 | 6 | 1 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainders from the bottom row up gives 11010110, the number we started with.
Two’s complement: how computers store negative numbers
A minus sign is fine on paper, but a register only holds a fixed number of bits. Most hardware stores signed integers in two’s complement: in an n-bit value the top bit is worth −2n−1 instead of +2n−1. To write −42 in 8 bits, start from 42 = 00101010, flip every bit to get 11010101, then add 1: 11010110. Notice that this is the same pattern as the default 11010110. Read as unsigned it means 214; read as signed 8-bit it means -42 (that is, −128 + 64 + 16 + 4 + 2). The bits don’t say which reading is meant; the program does. That is why the tool asks for a width, and why it reports “out of range” when 214 is encoded as signed 8-bit, whose largest value is 127.
Common mistakes
- Reading remainders top to bottom. The first remainder is the rightmost bit. Reverse the list.
- Starting the powers at 1. The rightmost place is 20 = 1, not 2.
- Dropping zeros in the middle.
1001(9) and11(3) are different numbers; every 0 holds a place. - Assuming a leading 1 means negative. Only in a signed format of a known width.
10000000is 128 unsigned and −128 as signed 8-bit. - Expecting decimal fractions to end in binary. 0.1 in decimal is
0.0(0011)in binary, repeating forever, which is why floating-point software prints sums like 0.1 + 0.2 slightly off. - Losing precision in a spreadsheet or plain JavaScript. Ordinary JavaScript numbers are exact only up to 253 − 1 = 9,007,199,254,740,991, a run of 53 ones in binary. This page uses
BigInt, so longer values stay exact.
Use cases
- Checking computer science or digital electronics homework, step by step
- Decoding register values, bit flags and permission masks from a datasheet or log
- Working out IPv4 subnet masks bit by bit, alongside the Subnet Calculator
- Converting hex dumps to decimal; for longer hex work, the Hex to Decimal converter adds byte order and a 16 × 16 chart
The safe-integer limit comes from the MDN reference for Number.MAX_SAFE_INTEGER, and arbitrary-length arithmetic from BigInt.
Frequently asked questions
1111 in binary is 15 in decimal: 8 + 4 + 2 + 1. Four ones is the largest value four bits can hold, which is why one hex digit runs from 0 to F (15). Likewise 11111111 is 255, the largest unsigned byte, and a run of n ones always equals 2 to the power n, minus 1.
100 in decimal is 1100100 in binary. The largest power of 2 that fits is 64, leaving 36; then 32 leaves 4; then 4 leaves 0. So the 1 bits are in the 64, 32 and 4 places: 1100100. Padded to a full byte it is 01100100, and in hex it is 64.
An unsigned whole number n greater than 0 needs as many bits as the length of its binary form, which is floor(log2 n) + 1. For example 255 needs 8 bits and 256 needs 9. A signed two's complement value needs one extra bit for the sign, so 8 bits only reach 127.
With a minus sign it is simply -101. Inside a computer, -5 is usually stored in two's complement: in 8 bits that is 11111011 (flip 00000101 to 11111010, then add 1). In 16 bits the same value is 1111111111111011, because sign extension fills the new high bits with ones.
Hex is a shorthand for binary. Each hex digit stands for exactly four bits, so a byte that takes eight binary digits fits in two hex digits, and you can convert between them by looking at one group of four at a time. Long binary strings are hard to read and easy to miscount; hex keeps the bit layout visible.
Octal (base 8) groups bits in threes, so each octal digit covers three bits. Its best-known modern use is Unix file permissions: chmod 755 means read, write and execute for the owner (7 = 111) and read plus execute for group and others (5 = 101). Each octal digit converts to three bits on its own, with no carrying.