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.

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.

Related Tools