The Binary to Decimal Converter converts any binary number to its decimal equivalent and back, visualizing each bit's positional weight. The most fundamental number system conversion in computer science — building intuition for digital number representation alongside the numerical result.
10
1
4
10
10
1
4
10
Binary and decimal are two different languages for expressing the same quantity. The decimal number 42 and the binary number 101010 represent the same value — they are just written using different positional value systems, one based on powers of 10 and the other on powers of 2. The binary to decimal converter makes this translation explicit, showing each bit's positional weight to build intuition alongside the numerical result.
In any positional number system, each digit position represents a power of the base. In binary:
Conversion: multiply each bit by its positional power and sum:
Decimal = Σ (bit_i × 2^i) for i from 0 to n−1
For 101010₂: (1×32) + (0×16) + (1×8) + (0×4) + (1×2) + (0×1) = 32 + 8 + 2 = 42. Use this online calculator to convert any binary number. The binary calculator handles conversions in all four major computing number systems (binary, decimal, hex, octal).
To convert decimal to binary, repeatedly divide by 2 and record the remainders. Reading the remainders from bottom to top gives the binary representation:
Convert 42 to binary: 42÷2=21 R0 → 21÷2=10 R1 → 10÷2=5 R0 → 5÷2=2 R1 → 2÷2=1 R0 → 1÷2=0 R1 → reading remainders bottom-up: 101010₂. The algorithm always terminates when the quotient reaches 0. The number of binary digits needed to represent a decimal number n is ⌊log₂(n)⌋ + 1.
Memorizing powers of 2 makes binary-decimal conversion much faster:
Practical implications: an 8-bit register holds 256 values (0–255 unsigned); a 16-bit port can address 65,536 memory locations; a 32-bit IP address can represent 4.29 billion unique addresses (hence IPv4 exhaustion). The binary arithmetic calculator and number system calculators provide complementary digital number tools.
Fractional values convert using repeated multiplication by 2: multiply the decimal fraction by 2, record the integer part as the next binary digit, and continue with the fractional remainder. For 0.625: 0.625×2=1.25 → bit = 1, fraction = 0.25; 0.25×2=0.5 → bit = 0, fraction = 0.5; 0.5×2=1.0 → bit = 1, fraction = 0; result = 0.101₂ = ½ + ⅛ = 0.625 ✓. Most decimal fractions do not terminate in binary (0.1 decimal repeats as 0.0001100110011...) — this is the root cause of floating-point arithmetic imprecision in all digital computing systems.
The decimal result is the conventional numerical value of your binary number. Each additional binary digit (bit) doubles the maximum representable value — an 8-bit number goes up to 255 (11111111₂), 16-bit up to 65535, 32-bit up to 4,294,967,295. If you enter a digit other than 0 or 1, the result will be -1 (invalid input indicator). The octal and hex outputs provide alternative compact representations of the same value, useful for programming contexts where hex or octal literals are preferred.
Inputs
Results
11111000 in binary = 248 decimal = 0xF8. This is a common octet value in IPv4 subnet masks (/29 mask: 255.255.255.248).
Inputs
Results
Binary 1101 = 8+4+0+1 = 13 decimal = D in hex. Four binary bits (a nibble) always map to a single hex digit.
How helpful was this calculator?
Be the first to rate!