Math

Binary to Decimal Converter

Convert binary numbers to decimal, with hexadecimal and octal equivalents.

Last updated · View algorithm, constants and default inputs (JSON)

Enter your values

Decimal 255
Results

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.

Maintained by: CalcDelta

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.

View algorithm, constants and default inputs (JSON)

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.

Embed this calculator

Copy the iframe snippet to place this calculator on your site. No account required. The snippet stays in sync with the inputs currently shown.

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.