Binary to Decimal Conversion
Binary (base 2) uses only 0 and 1. To convert binary to decimal, multiply each digit by 2 raised to its position power (starting from 0 on the right) and sum the results.
Example: 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13.
Number base conversion is a daily skill for software engineers and computer scientists. Binary (base 2) is how CPUs process data at the hardware level; hexadecimal (base 16) is the standard notation for memory addresses, color codes (#FF5733), and byte values in debugging. Octal (base 8) appears in Unix file permissions (chmod 755). This converter handles bases 2 through 36, supports both integer and fractional parts, and shows the step-by-step positional conversion — making it useful for learning binary arithmetic, designing low-level systems, or decoding network packet data.
Type the number you want to convert. Use 0x, 0b, or 0o prefixes for auto-detection.
Choose the base of your input number, or use auto-detect.
Select which base(s) to convert to - single base or all common bases.
See your converted number with optional step-by-step explanation.
To convert any base to decimal, multiply each digit by the base raised to its position power, then sum all values. For example, binary 1010 = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0 = 10.
Value = Σ(digit × base^position)
Use prefixes to quickly enter numbers: 0b for binary, 0o for octal, 0x for hexadecimal
Each hexadecimal digit equals exactly 4 binary digits - useful for quick mental conversion
When converting large numbers, work in groups of digits for easier calculation
Remember: A=10, B=11, C=12, D=13, E=14, F=15 in hexadecimal
Binary is fundamental - all other conversions go through binary internally in computers
Convert numbers instantly between binary, hexadecimal, octal, decimal, and any base from 2 to 36. Essential tool for programmers, students, and anyone working with different number systems.
Binary (base 2) uses only 0 and 1. To convert binary to decimal, multiply each digit by 2 raised to its position power (starting from 0 on the right) and sum the results.
Example: 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13.
Hexadecimal (base 16) uses 0-9 and A-F. It's popular in programming because each hex digit represents exactly 4 binary bits.
FF in hex = 255 in decimal = 11111111 in binary.
Each base has its purpose in computing and mathematics.
A number base (also called a radix) is the count of unique digits a positional number system uses to represent values. Base 10 uses ten digits (0-9); base 2 uses two (0 and 1).
In any positional system, each digit's place holds a weight equal to the base raised to that position's power, counting from zero on the right. So the decimal 253 means 2×10² + 5×10¹ + 3×10⁰.
According to Wolfram MathWorld, this positional principle lets a small set of symbols express arbitrarily large numbers, which is why base conversion is fundamentally just re-expressing the same quantity with different place values.
To convert a decimal number to any target base, repeatedly divide by that base and collect the remainders, then read them from last to first.
Converting 156 to hexadecimal: 156 ÷ 16 = 9 remainder 12 (C), and 9 ÷ 16 = 0 remainder 9, so reading upward gives 9C. Verify: 9×16 + 12 = 144 + 12 = 156.
Khan Academy teaches this same divide-and-record technique for binary and other bases. It works for any radix from 2 to 36 because each division isolates the least significant digit first, building the result one place value at a time.
Because 8 and 16 are powers of 2, you can convert binary directly by grouping bits instead of going through decimal. Group binary digits into sets of three (from the right) for octal, or sets of four for hexadecimal, padding with leading zeros as needed.
Example: binary 11010110 groups as 1101 0110 → D6 in hex, or as 011 010 110 → 326 in octal. Verify both against decimal: 214.
Wolfram MathWorld notes this grouping shortcut is exact precisely because one octal digit maps to three bits and one hex digit maps to four bits.
The core formula for reading any base into decimal is Value = Σ(dₙ × baseⁿ), where each digit dₙ is multiplied by the base raised to its position n counting from zero on the right.
For hexadecimal 2AF: 2×16² + 10×16¹ + 15×16⁰ = 512 + 160 + 15 = 687.
Encyclopaedia Britannica describes this weighted-sum structure as the defining feature of positional notation, distinguishing it from non-positional systems like Roman numerals. The same formula handles fractional parts by using negative exponents, so the digit after a radix point carries a weight of base⁻¹.
Different bases dominate different computing tasks:
Understanding these bases helps programmers debug low-level data, and Britannica notes the binary system's central role in the design of all modern digital computers.
Base 36 is the largest base that fits comfortably into the standard alphanumeric character set, using the ten digits 0-9 plus the 26 letters A-Z for values 10 through 35. That gives exactly 36 distinct symbols.
It is popular for compactly encoding large numbers as short strings, such as URL shorteners and unique IDs, because it packs more information per character than decimal or hex.
For any base above 10, letters simply extend the digit set: A=10, B=11, up through Z=35. This converter supports every base from 2 to 36 using this convention.
Each position in a binary number carries a weight that is a power of two, so knowing these powers makes binary conversion fast. From the right, the weights are 1, 2, 4, 8, 16, 32, 64, 128, then 256, 512, and 1024 (which is 2¹⁰).
This is why an 8-bit byte holds values 0 to 255: the sum of the first eight weights (1 through 128) is 255.
Wolfram MathWorld catalogs powers of two as one of the most fundamental integer sequences in computing. Memorizing them up to 1024 lets you convert small binary numbers mentally without repeated division, while for larger values a logarithm calculator quickly tells you how many bits a number needs, since the bit count is simply its base-2 logarithm rounded up.
Double-checking with the positional formula catches all four.
Data sourced from trusted institutions
All formulas verified against official standards.