What is the binary number system?
A way of writing numbers with only two digits, 0 and 1. Each place is worth twice the one to its right, so 101 means 4 + 1 = 5.
Type a number in binary, decimal, hex or octal and read it in every other base at once, with the working shown step by step.
Base 2: the digits 0 and 1.
Base 10: the everyday digits 0 to 9.
Base 16: 0 to 9, then A to F.
Base 8: the digits 0 to 7.
0 to 9, then A to Z.
8 bits, unsigned. Press a bit to flip it.
Type a number in any box to see it in every other base.
Each step shows here once there is a number: place values, divisions or groups of bits.
Auto uses as many bits as the number needs. A set width pads with zeros and holds its range.
−5 stays −101 in binary. Pick Two's complement to see how a computer stores it.
Type two numbers to see the answer.
The sum is laid out here in columns, with the carries.
Every number from 0 to 255 in binary, hex and octal, with its character. Press a number to convert it.
| Decimal | Binary | Hex | Octal | Character |
|---|---|---|---|---|
| 0000 0000 | 00 | 0 | NUL | |
| 0000 0001 | 01 | 1 | Control | |
| 0000 0010 | 02 | 2 | Control | |
| 0000 0011 | 03 | 3 | Control | |
| 0000 0100 | 04 | 4 | Control | |
| 0000 0101 | 05 | 5 | Control | |
| 0000 0110 | 06 | 6 | Control | |
| 0000 0111 | 07 | 7 | Bell | |
| 0000 1000 | 08 | 10 | Backspace | |
| 0000 1001 | 09 | 11 | Tab | |
| 0000 1010 | 0A | 12 | Line feed | |
| 0000 1011 | 0B | 13 | Control | |
| 0000 1100 | 0C | 14 | Control | |
| 0000 1101 | 0D | 15 | Carriage return | |
| 0000 1110 | 0E | 16 | Control | |
| 0000 1111 | 0F | 17 | Control | |
| 0001 0000 | 10 | 20 | Control | |
| 0001 0001 | 11 | 21 | Control | |
| 0001 0010 | 12 | 22 | Control | |
| 0001 0011 | 13 | 23 | Control | |
| 0001 0100 | 14 | 24 | Control | |
| 0001 0101 | 15 | 25 | Control | |
| 0001 0110 | 16 | 26 | Control | |
| 0001 0111 | 17 | 27 | Control | |
| 0001 1000 | 18 | 30 | Control | |
| 0001 1001 | 19 | 31 | Control | |
| 0001 1010 | 1A | 32 | Control | |
| 0001 1011 | 1B | 33 | Escape | |
| 0001 1100 | 1C | 34 | Control | |
| 0001 1101 | 1D | 35 | Control | |
| 0001 1110 | 1E | 36 | Control | |
| 0001 1111 | 1F | 37 | Control | |
| 0010 0000 | 20 | 40 | Space | |
| 0010 0001 | 21 | 41 | ! | |
| 0010 0010 | 22 | 42 | " | |
| 0010 0011 | 23 | 43 | # | |
| 0010 0100 | 24 | 44 | $ | |
| 0010 0101 | 25 | 45 | % | |
| 0010 0110 | 26 | 46 | & | |
| 0010 0111 | 27 | 47 | ' | |
| 0010 1000 | 28 | 50 | ( | |
| 0010 1001 | 29 | 51 | ) | |
| 0010 1010 | 2A | 52 | * | |
| 0010 1011 | 2B | 53 | + | |
| 0010 1100 | 2C | 54 | , | |
| 0010 1101 | 2D | 55 | - | |
| 0010 1110 | 2E | 56 | . | |
| 0010 1111 | 2F | 57 | / | |
| 0011 0000 | 30 | 60 | 0 | |
| 0011 0001 | 31 | 61 | 1 | |
| 0011 0010 | 32 | 62 | 2 | |
| 0011 0011 | 33 | 63 | 3 | |
| 0011 0100 | 34 | 64 | 4 | |
| 0011 0101 | 35 | 65 | 5 | |
| 0011 0110 | 36 | 66 | 6 | |
| 0011 0111 | 37 | 67 | 7 | |
| 0011 1000 | 38 | 70 | 8 | |
| 0011 1001 | 39 | 71 | 9 | |
| 0011 1010 | 3A | 72 | : | |
| 0011 1011 | 3B | 73 | ; | |
| 0011 1100 | 3C | 74 | < | |
| 0011 1101 | 3D | 75 | = | |
| 0011 1110 | 3E | 76 | > | |
| 0011 1111 | 3F | 77 | ? | |
| 0100 0000 | 40 | 100 | @ | |
| 0100 0001 | 41 | 101 | A | |
| 0100 0010 | 42 | 102 | B | |
| 0100 0011 | 43 | 103 | C | |
| 0100 0100 | 44 | 104 | D | |
| 0100 0101 | 45 | 105 | E | |
| 0100 0110 | 46 | 106 | F | |
| 0100 0111 | 47 | 107 | G | |
| 0100 1000 | 48 | 110 | H | |
| 0100 1001 | 49 | 111 | I | |
| 0100 1010 | 4A | 112 | J | |
| 0100 1011 | 4B | 113 | K | |
| 0100 1100 | 4C | 114 | L | |
| 0100 1101 | 4D | 115 | M | |
| 0100 1110 | 4E | 116 | N | |
| 0100 1111 | 4F | 117 | O | |
| 0101 0000 | 50 | 120 | P | |
| 0101 0001 | 51 | 121 | Q | |
| 0101 0010 | 52 | 122 | R | |
| 0101 0011 | 53 | 123 | S | |
| 0101 0100 | 54 | 124 | T | |
| 0101 0101 | 55 | 125 | U | |
| 0101 0110 | 56 | 126 | V | |
| 0101 0111 | 57 | 127 | W | |
| 0101 1000 | 58 | 130 | X | |
| 0101 1001 | 59 | 131 | Y | |
| 0101 1010 | 5A | 132 | Z | |
| 0101 1011 | 5B | 133 | [ | |
| 0101 1100 | 5C | 134 | \ | |
| 0101 1101 | 5D | 135 | ] | |
| 0101 1110 | 5E | 136 | ^ | |
| 0101 1111 | 5F | 137 | _ | |
| 0110 0000 | 60 | 140 | ` | |
| 0110 0001 | 61 | 141 | a | |
| 0110 0010 | 62 | 142 | b | |
| 0110 0011 | 63 | 143 | c | |
| 0110 0100 | 64 | 144 | d | |
| 0110 0101 | 65 | 145 | e | |
| 0110 0110 | 66 | 146 | f | |
| 0110 0111 | 67 | 147 | g | |
| 0110 1000 | 68 | 150 | h | |
| 0110 1001 | 69 | 151 | i | |
| 0110 1010 | 6A | 152 | j | |
| 0110 1011 | 6B | 153 | k | |
| 0110 1100 | 6C | 154 | l | |
| 0110 1101 | 6D | 155 | m | |
| 0110 1110 | 6E | 156 | n | |
| 0110 1111 | 6F | 157 | o | |
| 0111 0000 | 70 | 160 | p | |
| 0111 0001 | 71 | 161 | q | |
| 0111 0010 | 72 | 162 | r | |
| 0111 0011 | 73 | 163 | s | |
| 0111 0100 | 74 | 164 | t | |
| 0111 0101 | 75 | 165 | u | |
| 0111 0110 | 76 | 166 | v | |
| 0111 0111 | 77 | 167 | w | |
| 0111 1000 | 78 | 170 | x | |
| 0111 1001 | 79 | 171 | y | |
| 0111 1010 | 7A | 172 | z | |
| 0111 1011 | 7B | 173 | { | |
| 0111 1100 | 7C | 174 | | | |
| 0111 1101 | 7D | 175 | } | |
| 0111 1110 | 7E | 176 | ~ | |
| 0111 1111 | 7F | 177 | Delete | |
| 1000 0000 | 80 | 200 | Control | |
| 1000 0001 | 81 | 201 | Control | |
| 1000 0010 | 82 | 202 | Control | |
| 1000 0011 | 83 | 203 | Control | |
| 1000 0100 | 84 | 204 | Control | |
| 1000 0101 | 85 | 205 | Control | |
| 1000 0110 | 86 | 206 | Control | |
| 1000 0111 | 87 | 207 | Control | |
| 1000 1000 | 88 | 210 | Control | |
| 1000 1001 | 89 | 211 | Control | |
| 1000 1010 | 8A | 212 | Control | |
| 1000 1011 | 8B | 213 | Control | |
| 1000 1100 | 8C | 214 | Control | |
| 1000 1101 | 8D | 215 | Control | |
| 1000 1110 | 8E | 216 | Control | |
| 1000 1111 | 8F | 217 | Control | |
| 1001 0000 | 90 | 220 | Control | |
| 1001 0001 | 91 | 221 | Control | |
| 1001 0010 | 92 | 222 | Control | |
| 1001 0011 | 93 | 223 | Control | |
| 1001 0100 | 94 | 224 | Control | |
| 1001 0101 | 95 | 225 | Control | |
| 1001 0110 | 96 | 226 | Control | |
| 1001 0111 | 97 | 227 | Control | |
| 1001 1000 | 98 | 230 | Control | |
| 1001 1001 | 99 | 231 | Control | |
| 1001 1010 | 9A | 232 | Control | |
| 1001 1011 | 9B | 233 | Control | |
| 1001 1100 | 9C | 234 | Control | |
| 1001 1101 | 9D | 235 | Control | |
| 1001 1110 | 9E | 236 | Control | |
| 1001 1111 | 9F | 237 | Control | |
| 1010 0000 | A0 | 240 | No-break space | |
| 1010 0001 | A1 | 241 | ¡ | |
| 1010 0010 | A2 | 242 | ¢ | |
| 1010 0011 | A3 | 243 | £ | |
| 1010 0100 | A4 | 244 | ¤ | |
| 1010 0101 | A5 | 245 | ¥ | |
| 1010 0110 | A6 | 246 | ¦ | |
| 1010 0111 | A7 | 247 | § | |
| 1010 1000 | A8 | 250 | ¨ | |
| 1010 1001 | A9 | 251 | © | |
| 1010 1010 | AA | 252 | ª | |
| 1010 1011 | AB | 253 | « | |
| 1010 1100 | AC | 254 | ¬ | |
| 1010 1101 | AD | 255 | Soft hyphen | |
| 1010 1110 | AE | 256 | ® | |
| 1010 1111 | AF | 257 | ¯ | |
| 1011 0000 | B0 | 260 | ° | |
| 1011 0001 | B1 | 261 | ± | |
| 1011 0010 | B2 | 262 | ² | |
| 1011 0011 | B3 | 263 | ³ | |
| 1011 0100 | B4 | 264 | ´ | |
| 1011 0101 | B5 | 265 | µ | |
| 1011 0110 | B6 | 266 | ¶ | |
| 1011 0111 | B7 | 267 | · | |
| 1011 1000 | B8 | 270 | ¸ | |
| 1011 1001 | B9 | 271 | ¹ | |
| 1011 1010 | BA | 272 | º | |
| 1011 1011 | BB | 273 | » | |
| 1011 1100 | BC | 274 | ¼ | |
| 1011 1101 | BD | 275 | ½ | |
| 1011 1110 | BE | 276 | ¾ | |
| 1011 1111 | BF | 277 | ¿ | |
| 1100 0000 | C0 | 300 | À | |
| 1100 0001 | C1 | 301 | Á | |
| 1100 0010 | C2 | 302 | Â | |
| 1100 0011 | C3 | 303 | Ã | |
| 1100 0100 | C4 | 304 | Ä | |
| 1100 0101 | C5 | 305 | Å | |
| 1100 0110 | C6 | 306 | Æ | |
| 1100 0111 | C7 | 307 | Ç | |
| 1100 1000 | C8 | 310 | È | |
| 1100 1001 | C9 | 311 | É | |
| 1100 1010 | CA | 312 | Ê | |
| 1100 1011 | CB | 313 | Ë | |
| 1100 1100 | CC | 314 | Ì | |
| 1100 1101 | CD | 315 | Í | |
| 1100 1110 | CE | 316 | Î | |
| 1100 1111 | CF | 317 | Ï | |
| 1101 0000 | D0 | 320 | Ð | |
| 1101 0001 | D1 | 321 | Ñ | |
| 1101 0010 | D2 | 322 | Ò | |
| 1101 0011 | D3 | 323 | Ó | |
| 1101 0100 | D4 | 324 | Ô | |
| 1101 0101 | D5 | 325 | Õ | |
| 1101 0110 | D6 | 326 | Ö | |
| 1101 0111 | D7 | 327 | × | |
| 1101 1000 | D8 | 330 | Ø | |
| 1101 1001 | D9 | 331 | Ù | |
| 1101 1010 | DA | 332 | Ú | |
| 1101 1011 | DB | 333 | Û | |
| 1101 1100 | DC | 334 | Ü | |
| 1101 1101 | DD | 335 | Ý | |
| 1101 1110 | DE | 336 | Þ | |
| 1101 1111 | DF | 337 | ß | |
| 1110 0000 | E0 | 340 | à | |
| 1110 0001 | E1 | 341 | á | |
| 1110 0010 | E2 | 342 | â | |
| 1110 0011 | E3 | 343 | ã | |
| 1110 0100 | E4 | 344 | ä | |
| 1110 0101 | E5 | 345 | å | |
| 1110 0110 | E6 | 346 | æ | |
| 1110 0111 | E7 | 347 | ç | |
| 1110 1000 | E8 | 350 | è | |
| 1110 1001 | E9 | 351 | é | |
| 1110 1010 | EA | 352 | ê | |
| 1110 1011 | EB | 353 | ë | |
| 1110 1100 | EC | 354 | ì | |
| 1110 1101 | ED | 355 | í | |
| 1110 1110 | EE | 356 | î | |
| 1110 1111 | EF | 357 | ï | |
| 1111 0000 | F0 | 360 | ð | |
| 1111 0001 | F1 | 361 | ñ | |
| 1111 0010 | F2 | 362 | ò | |
| 1111 0011 | F3 | 363 | ó | |
| 1111 0100 | F4 | 364 | ô | |
| 1111 0101 | F5 | 365 | õ | |
| 1111 0110 | F6 | 366 | ö | |
| 1111 0111 | F7 | 367 | ÷ | |
| 1111 1000 | F8 | 370 | ø | |
| 1111 1001 | F9 | 371 | ù | |
| 1111 1010 | FA | 372 | ú | |
| 1111 1011 | FB | 373 | û | |
| 1111 1100 | FC | 374 | ü | |
| 1111 1101 | FD | 375 | ý | |
| 1111 1110 | FE | 376 | þ | |
| 1111 1111 | FF | 377 | ÿ |
Made for computer science homework, binary to denary exam questions and everyday code: each answer lists its place values or its divisions by 2.
Every number is worked out exactly in this tab, even hundreds of digits long, with no sign-up and nothing sent to a server.
Type in the box for the base you have, read the others, then follow the working.
Write your number in the box for its base: Binary, Decimal, Hex or Octal. Spaces and a 0x or 0b prefix are fine.
The other boxes fill in as you type: 1011 in binary is 11 in decimal, B in hex and 13 in octal, each ready to copy.
The Working lists each digit times its place value, or each division by 2, to check an answer or learn the method.
Each place in a binary number is worth twice the place to its right: 1, 2, 4, 8, 16, 32 and so on, counting from the right. To convert binary to decimal, write those place values over the digits and add up the ones that sit over a 1. UK schools call this binary to denary.
Take 101101. From the left its places are worth 32, 16, 8, 4, 2 and 1. The 1s sit under 32, 8, 4 and 1, so the number is 32 + 8 + 4 + 1 = 45. A binary number that ends in 1 is always odd, which makes a quick check on any answer.
The method works in any base: multiply each digit by its place value, then add. The Working above gives every digit its own line, zeros included, and puts the sum last, the way a teacher asks you to show it.
Divide the number by 2 and write down the remainder, which is always 0 or 1. Divide the answer by 2 again, and keep going until you reach 0. The remainders, read from the last one back up to the first, are the number in binary.
For 45: 45 ÷ 2 = 22 r 1, 22 ÷ 2 = 11 r 0, 11 ÷ 2 = 5 r 1, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0 and 1 ÷ 2 = 0 r 1. Reading the remainders up from the bottom gives 101101. Divide by 16 instead and you get hex digits; divide by 8 and you get octal.
A number with a point converts in two halves. The part after the point is multiplied by 2 again and again, and each whole part is the next digit: 0.625 gives 1, 0, 1, so 2.625 is 10.101. Some decimals, like 0.1, never end in binary, and the tool shows which digits repeat.
Hexadecimal, or hex, counts in sixteens. After 0 to 9 come A to F for 10 to 15, and each place is worth 16 times the one to its right: 1, 16, 256, 4,096. So 2AF is 2 × 256 + 10 × 16 + 15 = 687, and FF is 255, the largest number one byte can hold.
To go from decimal to hex, divide by 16 and write each remainder as a hex digit, just as you divide by 2 for binary. 687 ÷ 16 = 42 r 15 (F), 42 ÷ 16 = 2 r 10 (A) and 2 ÷ 16 = 0 r 2, which reads up as 2AF.
Hex and binary line up exactly: every hex digit is four bits. Split a binary number into groups of four from the right and swap each group for its digit, so 1111 1101 1010 is FDA. Octal works the same way with groups of three. Colour codes such as #FF8000 are hex too.
Computers store a negative whole number as its two's complement. Write the positive number in the bits you have, flip every bit, then add 1. In 8 bits, 5 is 00000101; flipped it is 11111010, and adding 1 gives 11111011, which is how −5 is stored.
The top bit gives the sign: 0 for zero or more, 1 for negative. That is why 8 bits hold −128 to 127 rather than 0 to 255, and why 11111011 reads as 251 unsigned but −5 signed. To read a pattern back, flip the bits and add 1 again.
The width matters, so set it under Bit width: −5 is FB in 8 bits, FFFB in 16 and FFFFFFFB in 32. With Negative numbers set to Two's complement, digits typed in binary, hex or octal are read as a pattern, so 11111011 comes back as −5.
Add, subtract, multiply or divide in binary, hex, octal or decimal, with carries shown as on paper.
Run AND, OR or XOR on two numbers, or shift one left or right, with every bit lined up in columns.
Pick 8, 16, 32 or 64 bits: negative numbers are written as two's complement and read back from it.
A fifth box converts to and from any base from 2 to 36. Base 36 uses the digits 0 to 9 and A to Z.
Numbers with a point convert too: binary 10.101 is 2.625, and 0.1 shows which binary digits repeat.
Every bit of the number is a button. Click one to flip it between 0 and 1 and each base updates.
Every conversion runs in this browser tab, so no number you type leaves your device.
Numbers are converted by code running in this tab, however long. No digit you type is sent online.
Only settings such as the bit width are kept in this browser. Reload and the number boxes are empty.
No account, no email and no daily cap: convert one number or a whole worksheet of them for free.
A way of writing numbers with only two digits, 0 and 1. Each place is worth twice the one to its right, so 101 means 4 + 1 = 5.
Eight. One byte holds 00000000 to 11111111 in binary, which is 0 to 255 in decimal or 00 to FF in hex.
1010: one 8, no 4, one 2 and no 1, so 8 + 2 = 10. Read as binary, 1010 is ten, not one thousand and ten.
11111111, eight 1s: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1. It is the largest number one byte holds, FF in hex.
A base 16 number system using 0 to 9 and A to F. One hex digit stands for four bits, so code uses it to write bytes short.
Number the places from the right as 1, 2, 4, 8 and so on, doubling each time, and add those holding a 1: 1101 is 8 + 4 + 1 = 13.
A circuit only has to tell two states apart, on or off. That is far more reliable than telling ten levels of voltage apart.
Denary is the UK school name for decimal. Add the place values under each 1: 0100 0110 is 64 + 4 + 2 = 70.
Still stuck, or found a problem? Email dobliquestudio@gmail.com and we will help.