Binary to Decimal Converter – Instant Number System Translation
Binary and decimal are the two number systems you encounter most in computing. Decimal (base 10) is what humans use every day; binary (base 2) is what every computer, microcontroller, and digital circuit operates on internally. This converter bridges the gap instantly — enter a binary string to get its decimal value, or flip the direction to convert decimal back to binary. It also shows the equivalent octal and hexadecimal representations in one step.
How Binary and Decimal Differ
Decimal uses ten digits (0–9); each position represents a power of 10. Binary uses only two digits (0 and 1); each position represents a power of 2. The rightmost bit (the least significant bit) has weight 2⁰ = 1, the next has weight 2¹ = 2, then 2² = 4, 2³ = 8, and so on. To convert binary to decimal you multiply each bit by its weight and sum the results. For example:
101101 = 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 45
To convert decimal to binary, repeatedly divide by 2 and collect the remainders in reverse order. 45 ÷ 2 = 22 R 1, 22 ÷ 2 = 11 R 0, 11 ÷ 2 = 5 R 1, 5 ÷ 2 = 2 R 1, 2 ÷ 2 = 1 R 0, 1 ÷ 2 = 0 R 1 → reading remainders bottom-up: 101101.
Fractional Binary Numbers
You can include a binary point (analogous to a decimal point) to convert non-integer values. Digits after the binary point use negative powers of 2: the first fractional bit is 2⁻¹ = 0.5, the second is 2⁻² = 0.25, the third is 2⁻³ = 0.125, and so on. For example:
1011.101 = 8 + 2 + 1 + 0.5 + 0.125 = 11.625
Note that most decimal fractions (such as 0.1) cannot be represented exactly in a finite number of binary digits — this is the same rounding phenomenon that affects all floating-point arithmetic. The converter uses up to 8 fractional digits by default, which is sufficient for most practical purposes.
Two's Complement Signed Integers
Modern processors store negative integers in two's complement form. In this representation a binary string is interpreted as negative if its most significant bit (MSB) is 1. Enable Signed mode and choose a bit width (8, 16, 32, or 64) to see the signed decimal value. For an N-bit signed integer the formula is:
signed value = unsigned value − 2ᴺ (when MSB = 1)
For example, 11110011 in 8-bit two's complement = 243 − 256 = −13. This mode is essential when reading CPU registers, debugging low-level code, or working with network packet fields that use signed integers.
Bit-Weight Visualization
The bit-weight table shows each digit aligned under its power-of-2 value. Bits set to 1 are highlighted; the sum of their weights equals the decimal result. This visual makes it easy to verify a conversion at a glance and is particularly helpful for students learning positional notation for the first time.
Why See Octal and Hexadecimal Too?
Binary, octal, and hexadecimal are closely related. Every three binary digits correspond to exactly one octal digit; every four binary digits correspond to exactly one hexadecimal digit. Programmers routinely switch between these representations when working with memory addresses, file permissions (Unix chmod uses octal), HTML/CSS color codes (hex), network protocol fields, and assembly or machine code. Displaying all four bases simultaneously saves multiple conversion steps.
Common Use Cases
Students in computer science and digital electronics courses use this tool to verify manual calculations and build intuition for positional number systems. Programmers reach for it when decoding raw binary data from embedded systems, serial ports, or file formats. Network engineers convert subnet masks and IP address octets. Security analysts decode binary-encoded packet fields. The step-by-step breakdown makes it a useful teaching aid for explaining how number system conversion works to others.
Accuracy and Limitations
Integer conversions are exact for all values within JavaScript's safe integer range (2⁵³ − 1, approximately 9 quadrillion). This covers 8-bit, 16-bit, 32-bit, and even most 64-bit use cases encountered in practice. Fractional conversions may have small rounding errors beyond 8 significant digits, which is standard behavior for floating-point arithmetic. A warning is displayed when the input exceeds the safe integer range.