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

Length: 4 bits · Size: 1 byte · Padded: 0000 1011

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

Showing 256 of 256
Binary table, 0–255: decimal, binary, hex and octal.
DecimalBinaryHexOctal
00000 000000
10000 000111
20000 001022
30000 001133
40000 010044
50000 010155
60000 011066
70000 011177
80000 1000810
90000 1001911
100000 1010A12
110000 1011B13
120000 1100C14
130000 1101D15
140000 1110E16
150000 1111F17
160001 00001020
170001 00011121
180001 00101222
190001 00111323
200001 01001424
210001 01011525
220001 01101626
230001 01111727
240001 10001830
250001 10011931
260001 10101A32
270001 10111B33
280001 11001C34
290001 11011D35
300001 11101E36
310001 11111F37
320010 00002040
330010 00012141
340010 00102242
350010 00112343
360010 01002444
370010 01012545
380010 01102646
390010 01112747
400010 10002850
410010 10012951
420010 10102A52
430010 10112B53
440010 11002C54
450010 11012D55
460010 11102E56
470010 11112F57
480011 00003060
490011 00013161
500011 00103262
510011 00113363
520011 01003464
530011 01013565
540011 01103666
550011 01113767
560011 10003870
570011 10013971
580011 10103A72
590011 10113B73
600011 11003C74
610011 11013D75
620011 11103E76
630011 11113F77
640100 000040100
650100 000141101
660100 001042102
670100 001143103
680100 010044104
690100 010145105
700100 011046106
710100 011147107
720100 100048110
730100 100149111
740100 10104A112
750100 10114B113
760100 11004C114
770100 11014D115
780100 11104E116
790100 11114F117
800101 000050120
810101 000151121
820101 001052122
830101 001153123
840101 010054124
850101 010155125
860101 011056126
870101 011157127
880101 100058130
890101 100159131
900101 10105A132
910101 10115B133
920101 11005C134
930101 11015D135
940101 11105E136
950101 11115F137
960110 000060140
970110 000161141
980110 001062142
990110 001163143
1000110 010064144
1010110 010165145
1020110 011066146
1030110 011167147
1040110 100068150
1050110 100169151
1060110 10106A152
1070110 10116B153
1080110 11006C154
1090110 11016D155
1100110 11106E156
1110110 11116F157
1120111 000070160
1130111 000171161
1140111 001072162
1150111 001173163
1160111 010074164
1170111 010175165
1180111 011076166
1190111 011177167
1200111 100078170
1210111 100179171
1220111 10107A172
1230111 10117B173
1240111 11007C174
1250111 11017D175
1260111 11107E176
1270111 11117F177
1281000 000080200
1291000 000181201
1301000 001082202
1311000 001183203
1321000 010084204
1331000 010185205
1341000 011086206
1351000 011187207
1361000 100088210
1371000 100189211
1381000 10108A212
1391000 10118B213
1401000 11008C214
1411000 11018D215
1421000 11108E216
1431000 11118F217
1441001 000090220
1451001 000191221
1461001 001092222
1471001 001193223
1481001 010094224
1491001 010195225
1501001 011096226
1511001 011197227
1521001 100098230
1531001 100199231
1541001 10109A232
1551001 10119B233
1561001 11009C234
1571001 11019D235
1581001 11109E236
1591001 11119F237
1601010 0000A0240
1611010 0001A1241
1621010 0010A2242
1631010 0011A3243
1641010 0100A4244
1651010 0101A5245
1661010 0110A6246
1671010 0111A7247
1681010 1000A8250
1691010 1001A9251
1701010 1010AA252
1711010 1011AB253
1721010 1100AC254
1731010 1101AD255
1741010 1110AE256
1751010 1111AF257
1761011 0000B0260
1771011 0001B1261
1781011 0010B2262
1791011 0011B3263
1801011 0100B4264
1811011 0101B5265
1821011 0110B6266
1831011 0111B7267
1841011 1000B8270
1851011 1001B9271
1861011 1010BA272
1871011 1011BB273
1881011 1100BC274
1891011 1101BD275
1901011 1110BE276
1911011 1111BF277
1921100 0000C0300
1931100 0001C1301
1941100 0010C2302
1951100 0011C3303
1961100 0100C4304
1971100 0101C5305
1981100 0110C6306
1991100 0111C7307
2001100 1000C8310
2011100 1001C9311
2021100 1010CA312
2031100 1011CB313
2041100 1100CC314
2051100 1101CD315
2061100 1110CE316
2071100 1111CF317
2081101 0000D0320
2091101 0001D1321
2101101 0010D2322
2111101 0011D3323
2121101 0100D4324
2131101 0101D5325
2141101 0110D6326
2151101 0111D7327
2161101 1000D8330
2171101 1001D9331
2181101 1010DA332
2191101 1011DB333
2201101 1100DC334
2211101 1101DD335
2221101 1110DE336
2231101 1111DF337
2241110 0000E0340
2251110 0001E1341
2261110 0010E2342
2271110 0011E3343
2281110 0100E4344
2291110 0101E5345
2301110 0110E6346
2311110 0111E7347
2321110 1000E8350
2331110 1001E9351
2341110 1010EA352
2351110 1011EB353
2361110 1100EC354
2371110 1101ED355
2381110 1110EE356
2391110 1111EF357
2401111 0000F0360
2411111 0001F1361
2421111 0010F2362
2431111 0011F3363
2441111 0100F4364
2451111 0101F5365
2461111 0110F6366
2471111 0111F7367
2481111 1000F8370
2491111 1001F9371
2501111 1010FA372
2511111 1011FB373
2521111 1100FC374
2531111 1101FD375
2541111 1110FE376
2551111 1111FF377

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.

DecimalBinaryHexOctal
256100000000100400
5001111101001F4764
51310000000012011001
1,00011111010003E81750
1,024100000000004002000
65,5351111111111111111FFFF177777

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

1286432168421
00001011
00001011 = 8 + 2 + 1 = 11

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

012345678910111213141516
0110111001011101111000100110101011110011011110111110000

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.

NumberBinaryHexOctal
1111
21022
31133
410044
510155
611066
711177
81000810
91001911
121100C14
23101111727
7510010114B113
82101001052122
88101100058130

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

BinaryOctalDecimalHexadecimal
Base281016
Digits0, 10–70–90–9, A–F
Code prefix0b0onone0x
255 is11111111377255FF
8 is10001088
Common useHardware, bitsUnix file permissionsEveryday countingColors, 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?

StringAs a numberHexIf it's text (padded to 8 bits)
001022not printable
1000003220space
100088not printable
101010Anot printable
10155not printable
101110462E.
110113Dnot printable
11010153355
11011054366
111111111111111165,535FFFFtwo bytes, not one character
10010000110100118,5374869Hi (as 0100100001101001)
1010101013411559 digits, not one byte
11000149311
1000013321!
101010422A*
100199not 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