All tools โ€บ Math & Numbers

๐Ÿ’ป Binary โ†” Decimal Converter

Convert between binary and decimal numbers.

Base 2 and base 10

Decimal uses ten digits and place values that are powers of ten. Binary uses two digits and place values that are powers of two: 1, 2, 4, 8, 16, 32, 64, 128 and onward.

Reading binary is a matter of adding the place values where a 1 appears. The byte 1011 is 8 + 0 + 2 + 1 = 11. Converting the other way, repeatedly divide by two and read the remainders from bottom to top.

Computers use binary because a transistor has two reliable states โ€” conducting or not. Distinguishing two voltage levels is robust; distinguishing ten would be far more error-prone.

Bits, bytes, and the units people confuse

A bit is one binary digit. Eight bits make a byte, which can represent 256 distinct values โ€” enough for one character in older encodings.

The persistent confusion is between decimal and binary prefixes. Storage manufacturers use decimal: one gigabyte is 1,000,000,000 bytes. Operating systems have historically used binary: one gibibyte is 1,073,741,824 bytes. That is why a "1 TB" drive shows as roughly 931 GB โ€” nothing is missing, the two figures simply count differently.

Network speeds add another trap by using bits rather than bytes. A 100 Mbps connection delivers around 12.5 MB per second at best, because there are eight bits in a byte.

Hexadecimal as shorthand

Hex uses sixteen digits โ€” 0 to 9 then A to F. Its value is that one hex digit maps exactly to four binary digits, so a byte is always two hex characters. This makes hex a compact, lossless shorthand for binary, which is why it appears in colour codes, memory addresses, and MAC addresses.

Converting between hex and binary requires no arithmetic at all: substitute each hex digit for its four-bit pattern. Decimal, by contrast, does not align with binary place values, which is why programmers reach for hex constantly and decimal rarely.

Common questions

Why do integers overflow at particular values?
Because a fixed number of bits holds a fixed range. A signed 32-bit integer spans โˆ’2,147,483,648 to 2,147,483,647; exceeding it wraps around.
Why can computers not represent 0.1 exactly?
One tenth is a repeating fraction in binary, exactly as one third repeats in decimal. Rounding at a fixed number of bits is why 0.1 + 0.2 does not quite equal 0.3 in floating-point arithmetic.
How are negative numbers stored?
Most commonly using two's complement, which lets the same addition circuitry handle both signs without special cases.
More in Math & Numbers
%Percentage Calculator
Work out percentages quickly โ€” what is X% of Y, and more.
๐Ÿ”บPercentage Change Calculator
Find the percent increase or decrease between two numbers.
๐ŸŽฒRandom Number Generator
Generate a random number in any range.
๐Ÿ›๏ธRoman Numeral Converter
Convert numbers into Roman numerals.