How this calculator works
Binary uses powers of two. Set bits contribute their place values; unset bits contribute zero. This tool converts non-negative integers exactly using integer arithmetic and can pad an unsigned word with leading zeros. A selected width must fit the value; the tool rejects overflow rather than dropping high bits. It reports minimum significant bits separately from padded width. Zero requires one displayed bit. Inputs are limited to 4096 characters and values to 4096 significant bits.
Formula
Decimal value = sum(bit_i x 2^i), counting i from 0 at the right. Unsigned b-bit range is 0 through 2^b - 1.
Worked example
Decimal 45 is 32 + 8 + 4 + 1, so its binary form is 101101. At 8 bits it becomes 00101101. Binary 11111111 is decimal 255 and hexadecimal FF.
Advertisement
Frequently asked questions
Are negative numbers supported?
This page uses unsigned words. A signed two's-complement interpretation depends on word width and needs a separate convention.
Do leading zeros change the value?
No. Choose a word width to retain padding in the result; minimum bits still describes the numeric value.
Does this decode text?
No. A number base conversion differs from decoding ASCII or Unicode bytes.