Binary to Decimal Converter
Convert binary numbers to decimal, with hexadecimal and octal equivalents.
Last updated · View algorithm, constants and default inputs (JSON)
About this calculator
Enter only 0s and 1s (up to 4,096 bits). The converter uses exact integer arithmetic, so long inputs do not lose precision. Bit count includes leading zeros; byte count is the number of 8-bit bytes needed to hold the entered string.
Worked example
calculated with the default values below
Binary number 11111111 Decimal 255 · Hexadecimal FF · Octal 377 · Bits 8 · Bytes 1.00
General background references
Disclaimer
These calculators give general mathematical results. They suit study, planning and estimation — verify anything that feeds a graded submission, a published figure or a financial commitment.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
n = Σ b_k × 2^k
- b_k
- Binary digit (0 or 1)
- k
- Position from the right, starting at 0
- n
- Decimal value
Characters other than 0 and 1 are stripped; hexadecimal and octal come from base conversion; 1 hex digit = 4 bits; bytes = bits/8.
Frequently asked questions
Why does eight ones in binary equal exactly two hundred fifty five?
Each binary digit is a power of two, so 11111111 is 128 plus 64 plus 32 plus 16 plus 8 plus 4 plus 2 plus 1, which sums to 255, the largest value eight bits can hold. That is also why eight bits make exactly one byte, and why the same number shows as FF in hex and 377 in octal. The Bits output counts the digits you entered while Bytes divides that count by eight.