Auto width counts the digits you typed, so 11111011 is an 8 bit pattern and reads as -5 signed, while 011111011 is 9 bits and stays 251. A minus sign in any base gives the two's complement pattern. Spaces, underscores and the 0b, 0o and 0x prefixes are ignored, and the arithmetic is exact up to 8,192 bits.
Every reading of the same bits
Unsigned, signed, grouped, inverted and as textPatterns worth loading
Each one fills the converter with the width it needs, so you can see the signed, text and overflow readings the guide below talks about.
Powers of two you keep meeting
Every binary place is a power of two, and a handful of them turn up everywhere in computing. The badge says what kind of limit each one is.
| Power | Exact value | Kind | Where it shows up |
|---|---|---|---|
| 2^4 | 16 | Nibble | Values in 4 bits, which is exactly one hex digit. |
| 2^7 | 128 | Text | The ASCII code points, 0 to 127, the one byte part of UTF-8. |
| 2^8 | 256 | Byte | Values in one byte, 0 to 255. |
| 2^10 | 1,024 | Prefix | One kibi. A kilo is 1,000, so a kibibyte is 2.4% bigger than a kilobyte. |
| 2^16 | 65,536 | 16 bit | Values in two bytes. UTF-8 needs three bytes at most for the first 65,536 code points. |
| 2^31 - 1 | 2,147,483,647 | Overflow | Largest signed 32 bit value. Unix time in seconds hits it at 03:14:07 UTC on 19 January 2038. |
| 2^32 | 4,294,967,296 | Address | Every IPv4 address, four octets of 8 bits. |
| 2^53 - 1 | 9,007,199,254,740,991 | Precision | Largest whole number a JavaScript Number holds exactly. This page uses BigInt to go past it. |
| 2^63 - 1 | 9,223,372,036,854,775,807 | Overflow | Largest signed 64 bit value. |
| 2^64 | 18,446,744,073,709,551,616 | 64 bit | Distinct 64 bit patterns, so the unsigned maximum is one less. |
Signed and unsigned ranges by width
The same number of bits covers the same number of values either way. Two's complement just slides half of them below zero, which is why the negative side always has one extra.
| Width | Unsigned range | Signed range, two's complement | Distinct values |
|---|---|---|---|
| 4 bit | 0 to 15 | -8 to 7 | 16 |
| 8 bit | 0 to 255 | -128 to 127 | 256 |
| 16 bit | 0 to 65,535 | -32,768 to 32,767 | 65,536 |
| 32 bit | 0 to 4,294,967,295 | -2,147,483,648 to 2,147,483,647 | 4,294,967,296 |
| 64 bit | 0 to 18,446,744,073,709,551,615 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | 18,446,744,073,709,551,616 |
Binary, bits and bytes, and why one pattern has several values
Place values, decimal to binary, two's complement and signed ranges, ASCII and UTF-8 text in binary, and the bitwise operators, with worked examples.
A binary converter turns a number or a piece of text into base 2, the ones and zeros a computer actually stores, and reads base 2 back again. The catch that most converters hide is that a string of bits does not have one meaning. The same eight bits 11111011 are 251 if you read them as an unsigned number, -5 if you read them as a signed two's complement number, FB in hexadecimal and not valid text at all. This converter shows every one of those readings at once, so you can see which one your program, your textbook or your network tool is using.
Place values: how to read a binary number
Binary works exactly like decimal except that each place is worth twice the place to its right instead of ten times. From the right the places are worth 1, 2, 4, 8, 16, 32, 64, 128 and so on, each a power of two. A single binary digit is called a bit, short for binary digit. To convert binary to decimal, add up the place values of every bit that is 1 and ignore the zeros.
- 1101 = 8 + 4 + 1 = 13
- 111001 = 32 + 16 + 8 + 1 = 57
- 101011 = 32 + 8 + 2 + 1 = 43
- 11010110 = 128 + 64 + 16 + 4 + 2 = 214
There is a second method that avoids writing out powers of two, often called doubling. Start with 0, and for each bit from left to right double the running total and add the bit. For 1011 that goes 1, then 2, then 5, then 11. It is the method to use in your head for long numbers, and it is how the converter explains any value with more than sixteen 1 bits.
Decimal to binary by repeated division
To go the other way, divide by 2 and keep the remainder, then divide the quotient by 2 again, until the quotient reaches 0. The remainders read from the last one back to the first are the binary number. For 13: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1, so 13 is 1101. For 19 the remainders are 1, 1, 0, 0, 1, which read upward give 10011. Type any decimal value above and the working box lists every division, with the remainders in bold.
Bits, nibbles and bytes
Bits are grouped because single bits are hard to read. Four bits make a nibble, which holds 16 values and matches exactly one hexadecimal digit, which is why the hex rung of the ladder is simply the nibbles rewritten. Eight bits make a byte, which holds 2^8 = 256 values, 0 to 255. The word byte was coined by Werner Buchholz at IBM in June 1956, spelled with a y so it could not be misread as bit. Network standards say octet when they need eight bits without any doubt, and an IPv4 address is four octets, 32 bits in all, which allows 4,294,967,296 addresses.
Bigger counts bring a naming clash. In December 1998 the IEC approved binary prefixes so that a kibibyte (KiB) is 2^10 = 1,024 bytes while a kilobyte (kB) is 1,000 bytes. The gap is 2.4% at the kilo step and widens with every step after it, since each binary prefix multiplies by 1,024 where the decimal one multiplies by 1,000. The grouping control above lets you print the pattern as nibbles, as bytes, or as one unbroken string, and the ladder always shows both groupings so you can copy whichever your tool expects.
Signed numbers and two's complement
Binary on its own has no minus sign, so computers reserve part of the pattern to mean negative. Almost every modern processor uses two's complement: in an N bit value the top bit, the most significant bit, is worth minus 2^(N-1) instead of plus. An N bit two's complement number therefore covers -2^(N-1) to 2^(N-1) - 1, which for 8 bits is -128 to 127. That is why 11111011 reads as 251 unsigned but as 251 - 256 = -5 signed.
To write a negative number, take the positive value, invert every bit, and add one. For -5 at 8 bits: +5 is 00000101, inverted it is 11111010, and adding one gives 11111011. Doing the same thing again brings you back to +5, so the negated rung of the ladder is simply the pattern multiplied by -1. For 50 the steps are 00110010, then 11001101, then 11001110.
Two quirks catch people out. The most negative value has no positive partner: at 8 bits, inverting 10000000 and adding one gives 10000000 again, so the two's complement of -128 is -128. Load the "-128" example to see the ladder flag it. The second is sign extension. Widening a negative number means copying the sign bit into the new places, not padding with zeros. -42 is 1010110 in 7 bits and 11010110 in 8 bits, which is also why the decimal 214 example reads as -42 in its signed rung. The design won because the same adding circuit serves signed and unsigned numbers alike, and IBM's System/360 made it the standard in 1964.
Width is part of the number
Because the top bit decides the sign, a pattern only has a signed value once you know how many bits it has. This converter's Auto width counts the digits you typed, so 11111011 is treated as 8 bits and 011111011 as 9 bits, and the second one stays at +251. Decimal input rounds up to whole bytes, and negative input picks the smallest of 8, 16, 32, 64 and so on that can hold it. Choose a fixed width to force the reading, and the converter tells you if the value does not fit.
Running out of width is a real failure, not a classroom one. Many systems count time as signed 32 bit seconds since 1 January 1970. The largest such value is 2^31 - 1 = 2,147,483,647, which falls at 03:14:07 UTC on 19 January 2038. One second later the count wraps to the most negative value and reads as 20:45:52 UTC on 13 December 1901. Load the 2038 example and switch the width to see the pattern that sits on the edge.
Text to binary: ASCII and UTF-8
Text becomes binary in two steps: each character is given a number, and that number is stored as bytes. ASCII, first published in 1963, numbers 128 characters from 0 to 127: 95 printable characters and 33 control codes. Capital A is 65, or 01000001, and small a is 97, or 01100001. The two differ by 32, which is a single bit, so changing the case of an ASCII letter flips exactly one bit. The word Hi is 01001000 01101001.
Almost everything outside plain English needs more than one byte. UTF-8, designed by Ken Thompson and Rob Pike in September 1992, keeps ASCII unchanged as single bytes and spends two, three or four bytes on the rest. A character up to U+007F takes 1 byte, up to U+07FF takes 2, up to U+FFFF takes 3 and up to U+10FFFF takes 4. The leading bits tell a reader how long each character is: 0xxxxxxx for one byte, 110xxxxx for the start of two, 1110xxxx for three and 11110xxx for four, with every continuation byte starting 10. The euro sign, U+20AC, becomes 11100010 10000010 10101100, and a laptop emoji, U+1F4BB, takes all four bytes and 32 bits.
This matters because UTF-8 is what the web actually uses. W3Techs measured it on 99.1% of websites with a known encoding on 23 September 2026, and Unicode 17.0, released on 9 September 2025, defines 159,801 characters that UTF-8 can carry. Pick Text in the converter and the ladder shows the characters, the bytes and the code points side by side, so a 2 character string that needs 7 bytes is obvious rather than a surprise. Going the other way, paste bytes as binary and the "As UTF-8 text" rung decodes them, or tells you why it cannot. For the full list of codes see the ASCII table.
Bitwise basics: AND, OR, XOR, NOT and shifts
Programs rarely convert numbers for their own sake. More often they test or change single bits, and those operations only make sense in binary. AND gives 1 only where both bits are 1: 0101 AND 0011 is 0001, so 5 AND 3 = 1. OR gives 1 where either bit is 1: 5 OR 3 = 7. XOR gives 1 where the bits differ: 5 XOR 3 = 6, and XOR with 1 flips a bit. NOT flips every bit, which is the inverted rung on the ladder. A mask is just a pattern chosen so that AND keeps the bits you care about: 0011 AND 0010 = 0010 shows the second bit is set.
Shifting moves every bit sideways. A left shift by n places multiplies by 2^n, so 00010111 shifted left twice is 01011100, 23 × 4 = 92. A right shift divides, and for signed numbers an arithmetic shift copies the sign bit in from the left, so -105 shifted right once is -53 rather than a large positive number. That is sign extension again, and the reason signed and unsigned values must not be mixed carelessly.
Why the answers here are exact
Most web converters store numbers as JavaScript floating point values, which are only exact up to 2^53 - 1 = 9,007,199,254,740,991. Past that, neighbouring whole numbers share one stored value and the last digits of a binary or decimal answer silently go wrong. This page does all of its arithmetic with BigInt, so a 64 bit, 128 bit or 8,192 bit pattern converts digit for digit. Fractions are a different problem: 0.1 has no finite binary form at all, which is why the converter sticks to whole numbers. For hexadecimal colour codes, memory addresses and hex dumps use the hex converter, and for powers and logarithms in a formula use the scientific calculator.
A short history of base 2
Gottfried Leibniz published his account of binary arithmetic, the Explication de l'Arithmétique Binaire, in 1703. George Boole's algebra of logic followed in 1854. In 1937 Claude Shannon's master's thesis showed how relay and switching circuits could be designed with Boolean logic, and in November of the same year George Stibitz finished his Model K relay computer at Bell Labs, which added in binary. Every rung of the ladder above descends from those two ideas: numbers as powers of two, and logic as bits switched on and off.
Frequently Asked Questions
Why does 11111011 come out as 251 in one place and -5 in another?
Both are right, because they read the same bits under different rules. Read unsigned, every bit is a positive place value, so 128 + 64 + 32 + 16 + 8 + 2 + 1 = 251. Read as an 8 bit two's complement number, the top bit is worth -128 instead of +128, so the total is 251 - 256 = -5. The converter prints both rungs, plus the width it assumed, so you can match whichever reading your language or datasheet uses.
How many bits do I need to store a number?
For a positive whole number, the count of binary digits is the answer: 214 is 11010110, so it needs 8 bits. As a rule, n bits hold 0 to 2^n - 1, so 255 fits in 8 bits and 256 needs 9. A signed number needs one extra bit for the sign, so 8 bits only reach 127 and -128. The "Bit length" rung shows the significant bits, and choosing a fixed width tells you straight away if the value does not fit.
Why does an emoji turn into 32 bits instead of 8?
Only the 128 ASCII characters fit in a single UTF-8 byte. Everything else takes two to four bytes, and anything above U+FFFF, which includes emoji, always takes four. A laptop emoji is U+1F4BB, stored as 11110000 10011111 10010010 10111011. Tools that print one 8 bit group per character are really only handling ASCII. Switch the input to Text and the ladder shows the character count and the byte count side by side.
Why does my binary turn into gibberish when I convert it to text?
Usually one of three things. The bits are not in whole bytes, often because a leading zero was dropped so a group has 7 digits instead of 8. The groups are split in the wrong place, so every byte after the first is shifted. Or the bytes were made with a different encoding than UTF-8. Paste the bits with a space between bytes and check the "As UTF-8 text" rung, which says why a sequence will not decode instead of guessing.
Why can a signed byte reach -128 but only +127?
Eight bits give exactly 256 patterns. Zero takes one of the patterns with a 0 sign bit, which leaves 127 positive values on that side and all 128 patterns with a 1 sign bit for the negatives. That lopsided range, -2^(N-1) to 2^(N-1) - 1, holds at every width. It is also why negating -128 at 8 bits gives -128 again, because +128 has no pattern to land on.
Can this converter handle numbers longer than 64 bits?
Yes. It uses exact BigInt arithmetic, so values up to 8,192 bits convert digit for digit, and the width menu goes to 128 bits with Auto covering anything longer. Ordinary JavaScript numbers are only exact up to 9,007,199,254,740,991, which is why some converters show wrong last digits for large binary values. Fractions are not supported, because many decimal fractions such as 0.1 have no finite binary form.
What do AND, OR and XOR actually do to binary numbers?
They compare two values one bit position at a time. AND keeps a 1 only where both inputs have a 1, so 0101 AND 0011 = 0001. OR keeps a 1 where either has one, giving 0111. XOR keeps a 1 only where they differ, giving 0110. In decimal those are 5 AND 3 = 1, 5 OR 3 = 7 and 5 XOR 3 = 6. AND with a mask tests bits, OR sets them and XOR flips them.