Skip to content

Binary to Decimal Converter

Convert binary to decimal or decimal to binary — instant results, free, and fully browser-based.

Last updated:

Mode: Binary → Decimal

How Binary-to-Decimal Conversion Works

Binary is a positional numeral system with a base (radix) of 2. Each digit — called a bit — represents a power of 2 that increases from right to left, starting at 20. To convert a binary number to decimal, multiply each bit by its positional weight and sum the results.

For example, the binary value 1101 converts as follows: (1 x 23) + (1 x 22) + (0 x 21) + (1 x 20) = 8 + 4 + 0 + 1 = 13 in decimal.

The algorithm is straightforward: iterate over each bit from the most-significant position to the least-significant, accumulating the total. Because binary uses only two symbols (0 and 1), the multiplication step simplifies to either adding the weight or skipping it entirely. This makes binary ideal for digital circuits that distinguish between two voltage levels.

Bit Widths, Signed Integers, and Two's Complement

In practice, binary values are stored in fixed-width containers. The most common bit widths are:

  • 8-bit (byte) — unsigned range 0 to 255; signed range -128 to 127
  • 16-bit — unsigned 0 to 65,535; signed -32,768 to 32,767
  • 32-bit — unsigned 0 to 4,294,967,295; signed roughly -2.1 billion to 2.1 billion
  • 64-bit — unsigned 0 to 18.4 quintillion; used by modern CPUs and languages like Rust and Go for default integers

Signed integers use two's complement encoding. The most-significant bit (MSB) acts as the sign bit: 0 for positive, 1 for negative. To find the decimal value of a negative two's complement number, invert all bits, add 1, then negate the result. For instance, the 8-bit value 11111100 inverts to 00000011 (3), plus 1 gives 4, so the decimal value is -4.

Understanding bit widths matters when debugging overflow bugs, reading memory dumps, or interpreting register values. An unsigned interpretation of the same bit pattern yields a vastly different number than a signed interpretation once the MSB is set.

Where Binary Shows Up in the Real World

Binary isn't just a textbook concept — it appears in everyday developer work:

  • Networking — IPv4 subnet masks like 255.255.255.0 are 11111111.11111111.11111111.00000000 in binary. Understanding the boundary between network and host bits requires binary fluency.
  • File permissions — Unix chmod values such as 755 map to three 3-bit groups: 111 101 101 (rwx r-x r-x). Each permission flag is a single bit.
  • Hardware registers — Microcontroller datasheets describe configuration registers bit by bit. Setting or clearing individual bits controls peripherals, interrupts, and clock sources.
  • Bitwise operations — Flags, masks, and packed data structures in languages like C, Rust, and Go rely on AND, OR, XOR, and shift operators that work directly on binary representations.
  • Color encoding — A 24-bit RGB color packs three 8-bit channels. The hex color #FF8000 is 11111111 10000000 00000000 in binary — useful when manipulating pixels at the bit level.

Powers of 2 and common binary values

Most binary values you'll encounter are either exact powers of two or round byte boundaries. Memorizing a handful of them makes reading binary much faster. Any value below can be pasted into the converter above, with or without the 0b prefix.

Binary Decimal Notes
1120
10221
100422
1000823
101010common exam value
111115max nibble (4 bits) = 0xF
100001624
10000006426
10000000128high bit of a byte; 27
11111111255max unsigned byte = 0xFF
10000000025628; first overflow past a byte
11111111111023max 10-bit value
100000000001024210 = 1 KiB
111111111111111165535max unsigned 16-bit = 0xFFFF

A quick trick for reading any 8-bit value: split it into two nibbles, convert each to hex (0-F), and you have the byte in hex. 11001010 splits into 1100 1010 = CA hex = 202 decimal.

Related Conversion Tools

If you work with number systems regularly, these companion tools can help:

  • Hex to Decimal Converter — convert hexadecimal values (base-16) to decimal, useful for reading memory addresses and color codes.
  • Number Base Converter — convert between any bases from 2 to 36. Handles binary, octal, decimal, and hexadecimal in one place.
  • Text to Binary Converter — encode plain text characters into their binary (ASCII/UTF-8) representations and vice versa.

All conversions run entirely in your browser — nothing is sent to a server, so your data stays private.

Frequently Asked Questions

What is binary?
Binary is a base-2 number system using only digits 0 and 1. It's the foundation of all computing — every piece of data in a computer is stored as binary.
Can I convert decimal to binary?
Yes. Use the swap button to toggle between binary-to-decimal and decimal-to-binary conversion.
What's the largest number supported?
Up to JavaScript's safe integer limit (2^53 - 1, or 9,007,199,254,740,991). For larger values, precision may be lost.
What does the `0b` prefix mean?
`0b` is a programming-language convention (Python, JavaScript ES6, C++) marking a literal as binary. Like `0x` for hex, it is not part of the value. This tool accepts binary with or without the prefix.
How are negative numbers represented in binary?
Negative integers use two’s complement encoding: flip all bits of the positive value and add 1. For example, `-1` as an 8-bit two’s complement is `11111111`. Choose the bit width that matches your use case.
Why do I see different bit widths like 8, 16, 32, 64?
CPUs and storage formats store integers in fixed widths. A value like `255` fits in 8 bits but `256` needs at least 9 bits, usually rounded up to 16. Pick the width that matches your target format.
What is 11111111 in decimal?
The 8-bit binary value 11111111 equals 255 in unsigned decimal — the largest value a single byte can hold. Interpreted as a signed 8-bit two's-complement integer, it's -1.
What is 10000000 in decimal?
The 8-bit binary 10000000 equals 128 in unsigned decimal. This is the smallest value with the high bit set; as a signed 8-bit integer, it represents -128.
What is 1010 in decimal?
The binary value 1010 equals 10 in decimal: (1×8) + (0×4) + (1×2) + (0×1) = 10.

Related Tools