Binary ↔ Decimal Converter
Free online Binary Decimal Converter. Convert binary base-2 to decimal base-10 instantly. Supports BigInt, two's complement, 8–256 bit signed, and step breakdown.
Binary ↔ Decimal Converter
| 2^5 | 2^4 | 2^3 | 2^2 | 2^1 | 2^0 |
|---|---|---|---|---|---|
| 32 | 16 | 8 | 4 | 2 | 1 |
| 1 | 1 | 0 | 1 | 0 | 1 |
| 32 | 16 | 0 | 4 | 0 | 1 |
| Step | Operation | Running Result |
|---|---|---|
| 1 | 1 × 2^5 (32) = 32 | 32 |
| 2 | 1 × 2^4 (16) = 16 | 48 |
| 3 | 0 × 2^3 (8) = 0 | 48 |
| 4 | 1 × 2^2 (4) = 4 | 52 |
| 5 | 0 × 2^1 (2) = 0 | 52 |
| 6 | 1 × 2^0 (1) = 1 | 53 |
Overview
The ToolMono Binary ↔ Decimal Converter is an enterprise-grade base conversion suite built for computer science professionals, systems engineers, network administrators, and students. It converts base-2 binary strings into base-10 decimal numbers—and vice versa—in real time with 100% client-side precision.
Featuring BigInt arbitrary-precision math (supporting 256-bit, 512-bit, and 1024-bit+ binary strings), Two's Complement signed representation, nibble/byte grouping, automatic zero-padding, dynamic place-value visual tables, and step-by-step mathematical explanations, ToolMono provides the definitive environment for digital hardware and software engineering. Explore companion tools: Decimal ↔ Hex Converter, Online Calculator, Scientific Calculator, JSON Formatter, and Hash Generator.
How to Use
Type any binary string (e.g. 110101) or decimal integer (e.g. 53) into the input box.
Choose Bit Width bounds (8 to 256-bit), enable Auto Zero-Padding, and group bits by Nibbles (4 bits) or Bytes (8 bits).
Examine the visual place value bit matrix ($2^n$ weights), Two's Complement sign representation, and step-by-step breakdown.
Click the Copy button to save formatted binary or decimal results to your clipboard.
Understanding Binary and Decimal Number Systems
Human civilization uses the Decimal (Base 10) system, while computer microprocessors operate exclusively using the Binary (Base 2) system.
Decimal System (Base 10)
Uses ten digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). Each position represents a power of 10 ($10^0 = 1, 10^1 = 10, 10^2 = 100$).
Binary System (Base 2)
Uses only two digits (0 and 1). Each position represents a power of 2 ($2^0 = 1, 2^1 = 2, 2^2 = 4, 2^3 = 8$).
Binary Place Value & Powers of 2 Reference
Binary uses positional notation. Each binary digit contributes its corresponding power of 2 only when the bit is 1. A 0 bit contributes nothing to the sum.
| Bit Position (Index) | Power of 2 ($2^n$) | Positional Place Value |
|---|---|---|
| 0 | 2⁰ | 1 |
| 1 | 2¹ | 2 |
| 2 | 2² | 4 |
| 3 | 2³ | 8 |
| 4 | 2⁴ | 16 |
| 5 | 2⁵ | 32 |
| 6 | 2⁶ | 64 |
| 7 | 2⁷ | 128 |
| 8 | 2⁸ | 256 |
| 9 | 2⁹ | 512 |
| 10 | 2¹⁰ | 1024 |
Example: Expanding 101101₂
How to Convert Binary to Decimal (Step-by-Step)
To manually convert any binary string to its decimal equivalent:
- Start at the rightmost binary digit (the Least Significant Bit, LSB at position 0).
- Assign each digit its corresponding power of 2 weight ($2^0, 2^1, 2^2, 2^3, \dots$).
- Multiply each binary digit (0 or 1) by its power of 2 weight.
- Add up all individual products to get the final base-10 decimal number.
Worked Example: Convert 110101₂ to Decimal
| Binary Digit | Bit Position | Power of 2 Weight | Calculation | Contribution |
|---|---|---|---|---|
| 1 | 5 | 2⁵ = 32 | 1 × 32 | 32 |
| 1 | 4 | 2⁴ = 16 | 1 × 16 | 16 |
| 0 | 3 | 2³ = 8 | 0 × 8 | 0 |
| 1 | 2 | 2² = 4 | 1 × 4 | 4 |
| 0 | 1 | 2¹ = 2 | 0 × 2 | 0 |
| 1 | 0 | 2⁰ = 1 | 1 × 1 | 1 |
How to Convert Decimal to Binary (Successive Division Method)
To convert a decimal integer to binary, use the Successive Division-by-2 Method:
- Divide the decimal number by 2 to get an integer quotient and a remainder (0 or 1).
- Record the remainder.
- Divide the quotient by 2 again.
- Repeat until the quotient becomes
0. - Read the remainders from bottom to top (last remainder is the MSB, first remainder is the LSB).
Worked Example: Convert 25₁₀ to Binary
| Division Step | Integer Quotient | Remainder | Binary Bit Position |
|---|---|---|---|
| 25 ÷ 2 | 12 | 1 | Bit 0 (LSB) |
| 12 ÷ 2 | 6 | 0 | Bit 1 |
| 6 ÷ 2 | 3 | 0 | Bit 2 |
| 3 ÷ 2 | 1 | 1 | Bit 3 |
| 1 ÷ 2 | 0 | 1 | Bit 4 (MSB) |
Binary Conversion Verification Method
When completing homework or engineering calculations, independently verify your result by performing the reverse calculation:
Bits, Bytes, Nibbles, MSB & LSB
A single binary digit (0 or 1).
Group of 4 bits (e.g. 1010). Equals 1 hex digit (0–F).
Group of 8 bits (e.g. 11001010). Unsigned range 0 to 255 ($2^8 = 256$).
The leftmost bit carrying the highest power of 2 weight.
The rightmost bit carrying the $2^0 = 1$ weight.
Leading Zeros & Fixed-Width Binary
Numerically, 1101₂ and 00001101₂ both equal 13₁₀. However, in low-level programming and hardware engineering, leading zeros preserve fixed-width byte boundaries (e.g., 8-bit, 16-bit, 32-bit registers).
Bit Width Range Reference Table
| Bit Width | Total Combinations ($2^N$) | Unsigned Decimal Range |
|---|---|---|
| 1-bit | 2 | 0 – 1 |
| 2-bit | 4 | 0 – 3 |
| 4-bit (Nibble) | 16 | 0 – 15 |
| 8-bit (Byte) | 256 | 0 – 255 |
| 16-bit (Word) | 65,536 | 0 – 65,535 |
| 32-bit (DWord) | 4,294,967,296 | 0 – 4,294,967,295 |
Key Features
Instant base conversion on every keystroke with immediate invalid character validation.
Convert arbitrary-length binary strings (256-bit, 512-bit, 1024-bit+) without precision truncation.
Interactive positional notation table showing bit index, $2^n$ power weight, bit state, and contribution.
Bit Width & Integer Bounds
| Bit Width | Unsigned Max Value (Decimal) | Unsigned Max Binary | Signed Range (Two's Complement) |
|---|---|---|---|
| 8-bit (Byte) | 255 | 1111 1111 | -128 to 127 |
| 16-bit (Word) | 65,535 | 11111111 11111111 | -32,768 to 32,767 |
| 32-bit (DWord) | 4,294,967,295 | 32 Ones | -2,147,483,648 to 2,147,483,647 |
| 64-bit (QWord) | 18,446,744,073,709,551,615 | 64 Ones | -9.22 × 10^18 to 9.22 × 10^18 |
| 128-bit / 256-bit | 1.15 × 10^77 | 256 Ones | Arbitrary Precision BigInt |
Two's Complement & Signed Binary
In digital hardware, negative numbers are encoded using Two's Complement notation. The leftmost bit (Most Significant Bit, MSB) serves as the sign bit:
Unsigned vs. Signed Binary Representation
The same 8-bit binary pattern 1111 1111₂ has two completely different mathematical interpretations depending on whether it is treated as an unsigned or signed (Two's Complement) integer:
All bits represent positive powers of 2 (range 0 to 255).
MSB bit 7 represents negative weight −128 (range −128 to 127).
ToolMono converts binary inputs as unsigned positive values unless Two's Complement signed representation mode is active.
Binary Fractional Values (Informational Guide)
Binary fractional numbers use negative powers of 2 ($2^-1 = 0.5, 2^-2 = 0.25, 2^-3 = 0.125$) to represent values right of the binary radix point:
Note: This ToolMono converter is designed specifically for integer binary/decimal conversions.
Binary Literal Prefix '0b' in Programming
Modern programming languages (JavaScript, Python, C++, Rust, Go) use the 0b or 0B prefix to declare binary literal values in code:
BigInt Arbitrary Precision Support
Standard IEEE 754 double-precision floating point numbers lose precision beyond $2^53 - 1$ (9,007,199,254,740,991). ToolMono utilizes JavaScript BigInt math to support arbitrary binary lengths without rounding errors.
Common Binary ↔ Decimal Reference Table (0–255)
| Decimal | 8-bit Binary | Hexadecimal | Octal |
|---|---|---|---|
| 0 | 0000 0000 | 0x00 | 0 |
| 1 | 0000 0001 | 0x01 | 1 |
| 2 | 0000 0010 | 0x02 | 2 |
| 4 | 0000 0100 | 0x04 | 4 |
| 8 | 0000 1000 | 0x08 | 10 |
| 16 | 0001 0000 | 0x10 | 20 |
| 32 | 0010 0000 | 0x20 | 40 |
| 64 | 0100 0000 | 0x40 | 100 |
| 128 | 1000 0000 | 0x80 | 200 |
| 192 | 1100 0000 | 0xC0 | 300 |
| 255 | 1111 1111 | 0xFF | 377 |
Programming Code Examples
Reference code snippets for converting Binary to Decimal and Decimal to Binary across major programming languages:
const bin = '110101';
const dec = parseInt(bin, 2); // 53
const bigDec = BigInt('0b' + bin); // 53nconst dec = 53; const bin = dec.toString(2); // '110101' const paddedBin = bin.padStart(8, '0'); // '00110101'
bin_str = '110101' dec_val = int(bin_str, 2) # 53
dec_val = 53 bin_str = bin(dec_val) # '0b110101' clean_bin = format(dec_val, '08b') # '00110101'
String bin = "110101"; int dec = Integer.parseInt(bin, 2); // 53
int dec = 53; String bin = Integer.toBinaryString(dec); // "110101"
package main
import ("fmt"; "strconv")
func main() {
dec, _ := strconv.ParseInt("110101", 2, 64) // 53
}package main
import "fmt"
func main() {
dec := 53
bin := fmt.Sprintf("%b", dec) // "110101"
}#include <stdio.h>
#include <stdlib.h>
int main() {
char *bin = "110101";
long dec = strtol(bin, NULL, 2); // 53
printf("%ld\n", dec);
return 0;
}#include <stdio.h>
void printBinary(int n) {
for (int i = 7; i >= 0; i--)
printf("%d", (n >> i) & 1);
}
// Output for 53: 00110101let bin = "110101"; let dec = i64::from_str_radix(bin, 2).unwrap(); // 53
let dec = 53;
let bin = format!("{:b}", dec); // "110101"string bin = "110101"; int dec = Convert.ToInt32(bin, 2); // 53
int dec = 53; string bin = Convert.ToString(dec, 2); // "110101"
$bin = '110101'; $dec = bindec($bin); // 53
$dec = 53; $bin = decbin($dec); // '110101'
let bin = "110101" let dec = Int(bin, radix: 2) // 53
let dec = 53 let bin = String(dec, radix: 2) // "110101"
val bin = "110101" val dec = bin.toInt(2) // 53
val dec = 53 val bin = dec.toString(2) // "110101"
Developer & Low-Level Computer Guide
In computer organization, binary is the fundamental language of logic gates, flip-flops, registers, and instruction caches:
- Bit Shifting: Shifting bits left (
x << 1) multiplies by 2; shifting right (x >> 1) divides by 2. - Subnet Masks: IP networks use binary bitmasks (e.g.
255.255.255.0= 24 ones followed by 8 zeros) to route packets. - Bitwise AND/OR/XOR: Fundamental operations used in graphics rendering, cryptography, and flag registers.
In-Depth Educational Guide
Understanding Positional Base-2 Notation
Decimal is a base-10 system using powers of 10 ($10^0 = 1, 10^1 = 10, 10^2 = 100$). Binary is a base-2 system using powers of 2 ($2^0 = 1, 2^1 = 2, 2^2 = 4, 2^3 = 8, 2^4 = 16, 2^5 = 32, 2^6 = 64, 2^7 = 128$).
Every binary digit (bit) represents a presence (1) or absence (0) of that power of 2. Summing all active power weights yields the exact base-10 decimal value.
AI Overview Answers
Binary to Decimal conversion is the mathematical translation of base-2 binary strings (composed of digits 0 and 1) into base-10 decimal numbers (0–9) based on positional powers of 2 ($2^n$).
Common Binary Conversion Mistakes to Avoid
Avoid these five frequent mistakes when performing manual binary conversions:
1. Reading Powers From Left to Right
The rightmost bit is position 0 (2⁰ = 1), not position 1. Power indexes increase from right to left.
2. Reading Division Remainders Top-to-Bottom
When converting decimal to binary via division by 2, remainders must be read from bottom to top (last remainder is the MSB).
3. Confusing Unsigned and Signed Binary
1111 1111₂ equals 255 in unsigned binary, but equals −1 in 8-bit Two's Complement signed representation.
4. Treating Binary Strings as Decimal
1010₂ is not one thousand and ten; it is 1×8 + 0×4 + 1×2 + 0×1 = 10₁₀.
5. Assuming Leading Zeros Change Numeric Value
00001101₂ and 1101₂ both equal decimal 13. Leading zeros fill bit-width fields without changing numeric value.
Real-World Applications of Binary Conversion
IP Networking & Subnetting
Subnet masks (e.g. 255.255.255.0 = 24 ones followed by 8 zeros) and CIDR prefixes require binary bitmasking.
Systems & Embedded Engineering
Microcontroller register manipulation, GPIO pin configuration, and hardware bit flags.
Software Development & Cryptography
Bitwise operations (AND, OR, XOR, Bit Shift), bitmasking flags, and binary data serialization.
Education & Computer Science
Verifying manual homework exercises, understanding computer architecture, and studying data representation.
Developer Binary Literal & Bitmask Examples
Standard 4-bit binary literal.
Full 8-bit byte (0xFF).
Highest 8-bit power weight.
Frequently Asked Questions
References & Standards
IEEE 754-2019: Standard for Floating-Point Arithmetic
International IEEE specification for binary floating-point representation.
ISO 80000-2: Mathematics Notation Standard
ISO standard for positional numeral systems and radix notations.
MDN Web Docs: Number.prototype.toString(radix)
Official JavaScript API reference for binary conversion.
Related Tools
Browse all toolsDecimal ↔ Hex Converter
Free online Decimal to Hex Converter. Convert base-10 to base-16 hexadecimal instantly. Supports BigInt, two's complement, 8–64 bit signed/unsigned, and live steps.
Online Calculator
Use ToolMono's free online calculator for quick everyday math, expressions, percentages, powers, roots, and parentheses. Includes calculation history and keyboard support.
Percentage Calculator
Calculate percentages instantly with ToolMono's free online percentage calculator. Find X% of Y, calculate what percent X is of Y, and solve reverse percentages.
Scientific Calculator
Use ToolMono's free Scientific Calculator for advanced mathematical calculations. Supports trigonometric, inverse, hyperbolic, logarithmic, exponential, factorial, scientific notation, degree/radian modes, calculation history, and 100% client-side processing.
Timestamp Converter
Convert Unix timestamps to dates and dates to timestamps instantly. Supports seconds, milliseconds, microseconds, nanoseconds, UTC, local time, and ISO 8601.
JSON Formatter
Free online JSON formatter, beautifier, and validator. Format, indent, minify, and inspect JSON with real-time syntax error detection in your browser. 100% client-side.
Hash Generator
Generate hashes and file checksums locally in your browser. Compare digests, copy results, and use MD5, SHA-1, SHA-2, SHA-3, BLAKE2, and supported HMAC algorithms.
Online UUID & GUID Generator
Generate secure UUID v4 and time-ordered UUID v7 identifiers online. Create single or bulk UUIDs with formatting controls, GUID support, and client-side Web Crypto generation.