Binary to Decimal Converter

-
Bit positionValue
bit 0 (rightmost)1
bit 12
bit 24
bit 38
bit 7 (a byte)128
The radix calls, per the MDN reference on Number.prototype.toString: n.toString(2) renders any safe integer in binary and parseInt(s, 2) reads it back - the same calls cover hex (16) and every base from 2 to 36.

Type a binary number (only 0s and 1s) and get its decimal value instantly - or type a decimal and get the binary form. The positional logic is what makes it click: each bit is worth double the one to its right, so 1010 is 8+0+2+0 = 10.

This is the foundation under every hex conversion and every bit of computer memory. The converter validates strictly - a stray 2 or a malformed group is flagged rather than silently misread, because in base-2 arithmetic there is no almost.

How to use

  1. Type a binary number (0s and 1s only) in the first box - the decimal appears instantly.
  2. Type a decimal number in the second box to get its binary form.
  3. Try 11111111 and watch it become 255 - the biggest number one byte can hold.

Frequently asked questions

How do you convert binary to decimal?

Each bit is worth a power of 2, doubling right to left: 1, 2, 4, 8, 16... Add the values of the 1-bits. 1101 = 8 + 4 + 0 + 1 = 13. The converter does the sum as you type.

How do you convert decimal to binary?

Divide by 2 repeatedly and read the remainders bottom-up - or subtract the largest power of 2 at each step. The converter uses the same algorithm internally and shows the binary padded to full bytes.

Why do computers use binary?

Two states (on/off, high/low voltage) are physically reliable; ten states are not. Every number, letter and pixel ends up as patterns of bits, which is why binary conversion is CS 101.

What is 2 to the power of 10 in binary terms?

1 followed by ten zeros: 10000000000 binary = 1,024 decimal. That near-thousand is why 'kilo' in computing historically meant 1,024 - the kilobyte that was secretly 1,024 bytes.

What is the biggest number in 8 bits?

11111111 binary = 255 decimal - eight ones, the sum 128+64+32+16+8+4+2+1. A byte holds 256 values only because zero counts too (0 through 255), and with one bit reserved for the sign the same eight bits span -128 to 127 in two's complement.

Why do binary numbers grow so long?

Each decimal digit carries about 3.32 bits of information (log2 of 10), so a six-digit decimal like 999,999 needs 20 bits - 2 to the 20th is 1,048,576, just over the mark. Binary is honest but verbose, which is exactly why programmers write hex: one hex digit packs four binary digits.

What is 0.1 in binary?

Infinitely long: 0.1 decimal is 0.0001100110011... repeating, which no finite register can hold exactly. That rounding is why 0.1 + 0.2 famously evaluates to 0.30000000000000004 in many programming languages - the converter here runs on full double precision and prints the exact decimal reading of whatever binary you type.

How does text become binary?

Every character is a number in disguise: the letter A is 65, a space is 32, and the whole ASCII table fits in 7 bits (with an eighth used for parity or extended characters). Type 01000001 into the converter and you get 65 - the machine-side identity of A. Longer text is that pattern repeated, and UTF-8 extends the same idea so any alphabet ends up as bytes, which is why a text file is binary that pretends to be letters.

What is a nibble in binary?

Four bits travelling together - a nibble, the half-byte unit. One nibble holds 16 values (0000 through 1111), which is exactly one hex digit: 1010 binary is A hexadecimal, 1111 is F. The 8-4-2-1 positional weights of a nibble are all the mental arithmetic needed for reading memory dumps, and two nibbles side by side make the byte the converter above pads to.

Related tools