Binary Numbers
Convert any number between binary, decimal, hex and octal, or look it up in the 0–255 chart.
- Free
- No sign-up
- 4 bases at once
- Shows the steps
Runs in your browser. Nothing you type leaves your device.
A binary number is any number written with 0s and 1s. This binary number converter turns one into decimal, hex and octal as you type, and it works the other way too. Below it is a chart of every value from 0 to 255, then a short guide to how binary numbers work. Looking for text instead of numbers? See binary numbers vs binary code.
Binary numbers chart: 0 to 255
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0000 0000 | 0 | 0 |
| 1 | 0000 0001 | 1 | 1 |
| 2 | 0000 0010 | 2 | 2 |
| 3 | 0000 0011 | 3 | 3 |
| 4 | 0000 0100 | 4 | 4 |
| 5 | 0000 0101 | 5 | 5 |
| 6 | 0000 0110 | 6 | 6 |
| 7 | 0000 0111 | 7 | 7 |
| 8 | 0000 1000 | 8 | 10 |
| 9 | 0000 1001 | 9 | 11 |
| 10 | 0000 1010 | A | 12 |
| 11 | 0000 1011 | B | 13 |
| 12 | 0000 1100 | C | 14 |
| 13 | 0000 1101 | D | 15 |
| 14 | 0000 1110 | E | 16 |
| 15 | 0000 1111 | F | 17 |
| 16 | 0001 0000 | 10 | 20 |
| 17 | 0001 0001 | 11 | 21 |
| 18 | 0001 0010 | 12 | 22 |
| 19 | 0001 0011 | 13 | 23 |
| 20 | 0001 0100 | 14 | 24 |
| 21 | 0001 0101 | 15 | 25 |
| 22 | 0001 0110 | 16 | 26 |
| 23 | 0001 0111 | 17 | 27 |
| 24 | 0001 1000 | 18 | 30 |
| 25 | 0001 1001 | 19 | 31 |
| 26 | 0001 1010 | 1A | 32 |
| 27 | 0001 1011 | 1B | 33 |
| 28 | 0001 1100 | 1C | 34 |
| 29 | 0001 1101 | 1D | 35 |
| 30 | 0001 1110 | 1E | 36 |
| 31 | 0001 1111 | 1F | 37 |
| 32 | 0010 0000 | 20 | 40 |
| 33 | 0010 0001 | 21 | 41 |
| 34 | 0010 0010 | 22 | 42 |
| 35 | 0010 0011 | 23 | 43 |
| 36 | 0010 0100 | 24 | 44 |
| 37 | 0010 0101 | 25 | 45 |
| 38 | 0010 0110 | 26 | 46 |
| 39 | 0010 0111 | 27 | 47 |
| 40 | 0010 1000 | 28 | 50 |
| 41 | 0010 1001 | 29 | 51 |
| 42 | 0010 1010 | 2A | 52 |
| 43 | 0010 1011 | 2B | 53 |
| 44 | 0010 1100 | 2C | 54 |
| 45 | 0010 1101 | 2D | 55 |
| 46 | 0010 1110 | 2E | 56 |
| 47 | 0010 1111 | 2F | 57 |
| 48 | 0011 0000 | 30 | 60 |
| 49 | 0011 0001 | 31 | 61 |
| 50 | 0011 0010 | 32 | 62 |
| 51 | 0011 0011 | 33 | 63 |
| 52 | 0011 0100 | 34 | 64 |
| 53 | 0011 0101 | 35 | 65 |
| 54 | 0011 0110 | 36 | 66 |
| 55 | 0011 0111 | 37 | 67 |
| 56 | 0011 1000 | 38 | 70 |
| 57 | 0011 1001 | 39 | 71 |
| 58 | 0011 1010 | 3A | 72 |
| 59 | 0011 1011 | 3B | 73 |
| 60 | 0011 1100 | 3C | 74 |
| 61 | 0011 1101 | 3D | 75 |
| 62 | 0011 1110 | 3E | 76 |
| 63 | 0011 1111 | 3F | 77 |
| 64 | 0100 0000 | 40 | 100 |
| 65 | 0100 0001 | 41 | 101 |
| 66 | 0100 0010 | 42 | 102 |
| 67 | 0100 0011 | 43 | 103 |
| 68 | 0100 0100 | 44 | 104 |
| 69 | 0100 0101 | 45 | 105 |
| 70 | 0100 0110 | 46 | 106 |
| 71 | 0100 0111 | 47 | 107 |
| 72 | 0100 1000 | 48 | 110 |
| 73 | 0100 1001 | 49 | 111 |
| 74 | 0100 1010 | 4A | 112 |
| 75 | 0100 1011 | 4B | 113 |
| 76 | 0100 1100 | 4C | 114 |
| 77 | 0100 1101 | 4D | 115 |
| 78 | 0100 1110 | 4E | 116 |
| 79 | 0100 1111 | 4F | 117 |
| 80 | 0101 0000 | 50 | 120 |
| 81 | 0101 0001 | 51 | 121 |
| 82 | 0101 0010 | 52 | 122 |
| 83 | 0101 0011 | 53 | 123 |
| 84 | 0101 0100 | 54 | 124 |
| 85 | 0101 0101 | 55 | 125 |
| 86 | 0101 0110 | 56 | 126 |
| 87 | 0101 0111 | 57 | 127 |
| 88 | 0101 1000 | 58 | 130 |
| 89 | 0101 1001 | 59 | 131 |
| 90 | 0101 1010 | 5A | 132 |
| 91 | 0101 1011 | 5B | 133 |
| 92 | 0101 1100 | 5C | 134 |
| 93 | 0101 1101 | 5D | 135 |
| 94 | 0101 1110 | 5E | 136 |
| 95 | 0101 1111 | 5F | 137 |
| 96 | 0110 0000 | 60 | 140 |
| 97 | 0110 0001 | 61 | 141 |
| 98 | 0110 0010 | 62 | 142 |
| 99 | 0110 0011 | 63 | 143 |
| 100 | 0110 0100 | 64 | 144 |
| 101 | 0110 0101 | 65 | 145 |
| 102 | 0110 0110 | 66 | 146 |
| 103 | 0110 0111 | 67 | 147 |
| 104 | 0110 1000 | 68 | 150 |
| 105 | 0110 1001 | 69 | 151 |
| 106 | 0110 1010 | 6A | 152 |
| 107 | 0110 1011 | 6B | 153 |
| 108 | 0110 1100 | 6C | 154 |
| 109 | 0110 1101 | 6D | 155 |
| 110 | 0110 1110 | 6E | 156 |
| 111 | 0110 1111 | 6F | 157 |
| 112 | 0111 0000 | 70 | 160 |
| 113 | 0111 0001 | 71 | 161 |
| 114 | 0111 0010 | 72 | 162 |
| 115 | 0111 0011 | 73 | 163 |
| 116 | 0111 0100 | 74 | 164 |
| 117 | 0111 0101 | 75 | 165 |
| 118 | 0111 0110 | 76 | 166 |
| 119 | 0111 0111 | 77 | 167 |
| 120 | 0111 1000 | 78 | 170 |
| 121 | 0111 1001 | 79 | 171 |
| 122 | 0111 1010 | 7A | 172 |
| 123 | 0111 1011 | 7B | 173 |
| 124 | 0111 1100 | 7C | 174 |
| 125 | 0111 1101 | 7D | 175 |
| 126 | 0111 1110 | 7E | 176 |
| 127 | 0111 1111 | 7F | 177 |
| 128 | 1000 0000 | 80 | 200 |
| 129 | 1000 0001 | 81 | 201 |
| 130 | 1000 0010 | 82 | 202 |
| 131 | 1000 0011 | 83 | 203 |
| 132 | 1000 0100 | 84 | 204 |
| 133 | 1000 0101 | 85 | 205 |
| 134 | 1000 0110 | 86 | 206 |
| 135 | 1000 0111 | 87 | 207 |
| 136 | 1000 1000 | 88 | 210 |
| 137 | 1000 1001 | 89 | 211 |
| 138 | 1000 1010 | 8A | 212 |
| 139 | 1000 1011 | 8B | 213 |
| 140 | 1000 1100 | 8C | 214 |
| 141 | 1000 1101 | 8D | 215 |
| 142 | 1000 1110 | 8E | 216 |
| 143 | 1000 1111 | 8F | 217 |
| 144 | 1001 0000 | 90 | 220 |
| 145 | 1001 0001 | 91 | 221 |
| 146 | 1001 0010 | 92 | 222 |
| 147 | 1001 0011 | 93 | 223 |
| 148 | 1001 0100 | 94 | 224 |
| 149 | 1001 0101 | 95 | 225 |
| 150 | 1001 0110 | 96 | 226 |
| 151 | 1001 0111 | 97 | 227 |
| 152 | 1001 1000 | 98 | 230 |
| 153 | 1001 1001 | 99 | 231 |
| 154 | 1001 1010 | 9A | 232 |
| 155 | 1001 1011 | 9B | 233 |
| 156 | 1001 1100 | 9C | 234 |
| 157 | 1001 1101 | 9D | 235 |
| 158 | 1001 1110 | 9E | 236 |
| 159 | 1001 1111 | 9F | 237 |
| 160 | 1010 0000 | A0 | 240 |
| 161 | 1010 0001 | A1 | 241 |
| 162 | 1010 0010 | A2 | 242 |
| 163 | 1010 0011 | A3 | 243 |
| 164 | 1010 0100 | A4 | 244 |
| 165 | 1010 0101 | A5 | 245 |
| 166 | 1010 0110 | A6 | 246 |
| 167 | 1010 0111 | A7 | 247 |
| 168 | 1010 1000 | A8 | 250 |
| 169 | 1010 1001 | A9 | 251 |
| 170 | 1010 1010 | AA | 252 |
| 171 | 1010 1011 | AB | 253 |
| 172 | 1010 1100 | AC | 254 |
| 173 | 1010 1101 | AD | 255 |
| 174 | 1010 1110 | AE | 256 |
| 175 | 1010 1111 | AF | 257 |
| 176 | 1011 0000 | B0 | 260 |
| 177 | 1011 0001 | B1 | 261 |
| 178 | 1011 0010 | B2 | 262 |
| 179 | 1011 0011 | B3 | 263 |
| 180 | 1011 0100 | B4 | 264 |
| 181 | 1011 0101 | B5 | 265 |
| 182 | 1011 0110 | B6 | 266 |
| 183 | 1011 0111 | B7 | 267 |
| 184 | 1011 1000 | B8 | 270 |
| 185 | 1011 1001 | B9 | 271 |
| 186 | 1011 1010 | BA | 272 |
| 187 | 1011 1011 | BB | 273 |
| 188 | 1011 1100 | BC | 274 |
| 189 | 1011 1101 | BD | 275 |
| 190 | 1011 1110 | BE | 276 |
| 191 | 1011 1111 | BF | 277 |
| 192 | 1100 0000 | C0 | 300 |
| 193 | 1100 0001 | C1 | 301 |
| 194 | 1100 0010 | C2 | 302 |
| 195 | 1100 0011 | C3 | 303 |
| 196 | 1100 0100 | C4 | 304 |
| 197 | 1100 0101 | C5 | 305 |
| 198 | 1100 0110 | C6 | 306 |
| 199 | 1100 0111 | C7 | 307 |
| 200 | 1100 1000 | C8 | 310 |
| 201 | 1100 1001 | C9 | 311 |
| 202 | 1100 1010 | CA | 312 |
| 203 | 1100 1011 | CB | 313 |
| 204 | 1100 1100 | CC | 314 |
| 205 | 1100 1101 | CD | 315 |
| 206 | 1100 1110 | CE | 316 |
| 207 | 1100 1111 | CF | 317 |
| 208 | 1101 0000 | D0 | 320 |
| 209 | 1101 0001 | D1 | 321 |
| 210 | 1101 0010 | D2 | 322 |
| 211 | 1101 0011 | D3 | 323 |
| 212 | 1101 0100 | D4 | 324 |
| 213 | 1101 0101 | D5 | 325 |
| 214 | 1101 0110 | D6 | 326 |
| 215 | 1101 0111 | D7 | 327 |
| 216 | 1101 1000 | D8 | 330 |
| 217 | 1101 1001 | D9 | 331 |
| 218 | 1101 1010 | DA | 332 |
| 219 | 1101 1011 | DB | 333 |
| 220 | 1101 1100 | DC | 334 |
| 221 | 1101 1101 | DD | 335 |
| 222 | 1101 1110 | DE | 336 |
| 223 | 1101 1111 | DF | 337 |
| 224 | 1110 0000 | E0 | 340 |
| 225 | 1110 0001 | E1 | 341 |
| 226 | 1110 0010 | E2 | 342 |
| 227 | 1110 0011 | E3 | 343 |
| 228 | 1110 0100 | E4 | 344 |
| 229 | 1110 0101 | E5 | 345 |
| 230 | 1110 0110 | E6 | 346 |
| 231 | 1110 0111 | E7 | 347 |
| 232 | 1110 1000 | E8 | 350 |
| 233 | 1110 1001 | E9 | 351 |
| 234 | 1110 1010 | EA | 352 |
| 235 | 1110 1011 | EB | 353 |
| 236 | 1110 1100 | EC | 354 |
| 237 | 1110 1101 | ED | 355 |
| 238 | 1110 1110 | EE | 356 |
| 239 | 1110 1111 | EF | 357 |
| 240 | 1111 0000 | F0 | 360 |
| 241 | 1111 0001 | F1 | 361 |
| 242 | 1111 0010 | F2 | 362 |
| 243 | 1111 0011 | F3 | 363 |
| 244 | 1111 0100 | F4 | 364 |
| 245 | 1111 0101 | F5 | 365 |
| 246 | 1111 0110 | F6 | 366 |
| 247 | 1111 0111 | F7 | 367 |
| 248 | 1111 1000 | F8 | 370 |
| 249 | 1111 1001 | F9 | 371 |
| 250 | 1111 1010 | FA | 372 |
| 251 | 1111 1011 | FB | 373 |
| 252 | 1111 1100 | FC | 374 |
| 253 | 1111 1101 | FD | 375 |
| 254 | 1111 1110 | FE | 376 |
| 255 | 1111 1111 | FF | 377 |
No number matches that search.
This binary conversion chart lists every number from 0 to 255 in decimal, binary, hex and octal. Type in the search box to filter, or jump to a block of 16. Every row has its own link, so /binary-code-translator/binary-numbers/#12 lands on 12.
Beyond 255
A byte holds 0 to 255. 256 needs a ninth bit. Tap a number to open it in the converter.
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 256 | 100000000 | 100 | 400 |
| 500 | 111110100 | 1F4 | 764 |
| 513 | 1000000001 | 201 | 1001 |
| 1,000 | 1111101000 | 3E8 | 1750 |
| 1,024 | 10000000000 | 400 | 2000 |
| 65,535 | 1111111111111111 | FFFF | 177777 |
What are binary numbers?
Binary numbers are numbers written in base 2, using only two digits: 0 and 1. Each digit is a bit, and each position is worth a power of two (1, 2, 4, 8, 16…). Add the positions that hold a 1 to get the decimal value: 1011 is 8 + 2 + 1 = 11.
Why two digits? A bit only has to be in one of two states: on or off, high voltage or low. That's the easiest thing for hardware to store without mistakes, so every computer counts this way underneath. "Base" is just the number of digits a system uses before it adds a new column. Decimal uses ten. Binary uses two, so it runs out of room fast: 1 + 1 is 10, read "one-zero", and it means two.
A group of eight bits is a byte. To keep binary from being mistaken for decimal, you'll see it written as 1011₂ or 0b1011. Every binary representation of a number is a string of bits like that, and a binary digit is just one character of the string.
What is the binary number system?
The binary number system is a positional system with two symbols. It works like decimal: a digit's value depends on where it sits. In 305, the 3 means three hundreds. In binary 101, the leftmost 1 means one four. The only thing that changes is the multiplier, ten for decimal and two for binary. (You'll also see it called the binary numeral system. Same thing.)
Place values in binary: 128, 64, 32 … 1
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
Each place is worth twice the place to its right. Read from the right and you get 1, 2, 4, 8, 16, 32, 64, 128. To read a number, write it under those values and add up whatever sits under a 1. 00001011 has 1s under 8, 2 and 1, so it's 11.
Leading zeros change nothing. 0010, 10 and 00000010 are all 2. They only matter when something needs a fixed width, like a byte. Eight places give you 2⁸ = 256 values, from 0 to 255. Four places give you 0 to 15.
Counting in binary: 0 to 16
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 10 | 11 | 100 | 101 | 110 | 111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 | 10000 |
Watch the right-hand digit: 0, 1, 0, 1. The next one flips every two numbers, the next every four. When every place is full (1111 is 15), the next number needs a new column, so 16 is 10000. It's the same thing that happens when 99 rolls over to 100. Counting 1 to 8 in binary goes 1, 10, 11, 100, 101, 110, 111, 1000.
The numbers people look up most
6 in binary is 110 (4 + 2). 12 in binary is 1100 (8 + 4). Here are the others people search for most, each linked to its row in the chart.
| Number | Binary | Hex | Octal |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 12 | 1100 | C | 14 |
| 23 | 10111 | 17 | 27 |
| 75 | 1001011 | 4B | 113 |
| 82 | 1010010 | 52 | 122 |
| 88 | 1011000 | 58 | 130 |
How to convert binary numbers
Binary conversion comes down to two moves. To get decimal, add the place values under each 1. To get binary from decimal, divide by 2 and collect the remainders. Hex and octal are shortcuts on top of that, because they group bits. Each card below gives one worked example and links to the full method.
Binary to decimal. Add the place values under each 1. 1011 → 8 + 2 + 1 = 11. See binary to decimal.
Decimal to binary. Divide by 2 and read the remainders from the bottom up. 13 → remainders 1, 0, 1, 1 read upward → 1101. See decimal to binary.
Binary to hex. Split the bits into groups of four from the right. Each group is one hex digit. 1111 0101 → F and 5 → F5. See binary to hex.
Binary calculator. Add, subtract, multiply and divide with the carries shown. 101 + 110 = 1011 (5 + 6 = 11). Try the binary calculator.
Number systems compared: binary, octal, decimal and hex
| Binary | Octal | Decimal | Hexadecimal | |
|---|---|---|---|---|
| Base | 2 | 8 | 10 | 16 |
| Digits | 0, 1 | 0–7 | 0–9 | 0–9, A–F |
| Code prefix | 0b | 0o | none | 0x |
| 255 is | 11111111 | 377 | 255 | FF |
| 8 is | 1000 | 10 | 8 | 8 |
| Common use | Hardware, bits | Unix file permissions | Everyday counting | Colors, memory addresses |
Nobody likes writing long strings of 1s and 0s by hand, because one slip ruins the number. Hex and octal exist to shorten them. Four bits make exactly one hex digit, and three bits make exactly one octal digit, so 1111 0101 is F5 with no arithmetic, just a lookup. That's why you see hex for memory addresses and colors, and octal for Unix permissions.
The count of digits a system uses is its base, also called the radix. Every system in the table works the same way: positions, and a multiplier that changes from one system to the next.
Where binary numbers are used
Bytes and storage. A file's size is a count of bytes, and each byte is a number from 0 to 255 stored as eight bits.
IP addresses. An IPv4 address is four bytes. The subnet mask 255.255.255.0 is 11111111.11111111.11111111.00000000: 24 ones, then eight zeros.
Colors. On the web, #FF8800 means red 255, green 136, blue 0. Each pair of hex digits is one byte, so each color channel runs from 0 to 255.
Unix permissions. chmod 755 is 111 101 101. Each octal digit is three bits: read, write, execute.
Binary numbers vs binary code
Got a string of 0s and 1s that spells words? Use the binary code translator. Binary numbers are values: 1011 is eleven. Binary code uses the same 0s and 1s to store text, so 01001000 is the letter H. The digits look identical, which is why people mix them up.
Not sure which one you have? The table below shows both readings of the strings people paste most.
Common binary strings: number or text?
| String | As a number | Hex | If it's text (padded to 8 bits) |
|---|---|---|---|
0010 | 2 | 2 | not printable |
100000 | 32 | 20 | space |
1000 | 8 | 8 | not printable |
1010 | 10 | A | not printable |
101 | 5 | 5 | not printable |
101110 | 46 | 2E | . |
1101 | 13 | D | not printable |
110101 | 53 | 35 | 5 |
110110 | 54 | 36 | 6 |
1111111111111111 | 65,535 | FFFF | two bytes, not one character |
100100001101001 | 18,537 | 4869 | Hi (as 0100100001101001) |
101010101 | 341 | 155 | 9 digits, not one byte |
110001 | 49 | 31 | 1 |
100001 | 33 | 21 | ! |
101010 | 42 | 2A | * |
1001 | 9 | 9 | not printable |
Strings from 110000 to 111001 are the digits 0 to 9 in text, with the leading 00 dropped: 110001 is the character 1. If you think yours is text, pad it to eight digits and paste it into the binary code translator linked above. And 100100001101001 is the two letters "Hi" with a leading zero missing: 0100100001101001.
Frequently asked questions
Quick answers: 1 to 8 in binary
What is 1 in binary?
1.
What is 2 in binary?
10: one two and no ones.
What is 3 in binary?
11: 2 + 1.
What is 4 in binary?
100: one four, no twos, no ones.
What is 5 in binary?
101: 4 + 1.
What is 6 in binary?
110: 4 + 2.
What is 7 in binary?
111: 4 + 2 + 1, the largest number that fits in three bits.
What is 8 in binary?
1000: a new place, one eight.
More questions
How do you find the decimal equivalent of a binary number?
Write the place values under each digit (… 8, 4, 2, 1) and add the ones that sit under a 1. For 1011, that's 8 + 2 + 1 = 11.
How many binary numbers can 8 bits hold?
256, because 2⁸ = 256. They run from 0 (00000000) to 255 (11111111).
Why do computers use binary?
Each bit needs only two states, such as on and off or high and low voltage. That's the simplest thing for hardware to store and read reliably, so everything a computer handles is built from bits.
Sources: G. W. Leibniz, Explication de l’Arithmétique Binaire (1703, English translation) · Donald Knuth, The Art of Computer Programming, Vol. 2, §4.1, Positional Number Systems
