Binary to Decimal Converter
Convert one integer exactly, compare signed and unsigned meaning, and see what widening or narrowing really changes.
Widen without changing the original bits
Loss preview — original input is unchanged
Discarded high bits:
Kept bits:
Binary place values, calculated exactly
A binary integer uses powers of two. From right to left, the places are 2⁰, 2¹, 2², and so on. This page parses at most 64 bits directly into BigInt; it never routes a 64-bit boundary through JavaScript Number, so sixty-four 1 bits remain the exact unsigned value 18446744073709551615.
Keep unsigned and signed meaning separate
Unsigned interpretation gives every bit a nonnegative place value. Signed two's complement instead treats a leading 1 as a negative value determined by the raw source width—the number of entered digits after separators are removed. The Target bit width selector controls only resizing. The converter labels both widths and both interpretations rather than guessing which convention your register, protocol, or debugger intended.
See both ways to widen a bit pattern
Zero extension adds leading zeroes and keeps the unsigned value. Sign extension repeats the leading bit and keeps the signed value. The two patterns are shown side by side because extending 11111111 from 8 to 16 bits can mean either 0000000011111111 = 255 or 1111111111111111 = -1.
Preview truncation before losing high bits
When the selected width is smaller than the entered bit count, the result names the discarded high bits and compares the surviving signed and unsigned values. It does not overwrite the original field until you explicitly confirm the kept bits.
Integer-only boundaries
The calculator accepts one integer, fixed 8/16/32/64-bit targets, and optional ASCII whitespace or underscores between bits. Copy writes a labeled receipt containing the direction, source and target widths, exact interpretations, and resize result. It does not parse fractions, floating point, executable expressions, text encodings, binary-coded decimal, files, or values wider than 64 bits.
Frequently asked questions
How do I convert binary to decimal?
Each bit has a power-of-two place value. Add the place values whose bits are 1. This converter does that with BigInt, then shows both the unsigned value and the signed two's-complement interpretation.
Why can the same bits mean 255 or -1?
With eight bits, 11111111 is unsigned 255. Under signed two's-complement interpretation, the leading 1 has negative weight, so the same eight bits mean -1. A bit pattern needs a width and signedness to have one intended value.
What is the difference between zero extension and sign extension?
Zero extension adds leading zeroes and preserves an unsigned value. Sign extension repeats the leading sign bit and preserves a signed two's-complement value. For 8-bit 11111111, widening to 16 bits produces different bit patterns for those two jobs.
What happens when I choose a smaller bit width?
The converter does not silently drop data. It previews the high bits that would be discarded and the resulting unsigned and signed values. The original input changes only after you press the confirmation button.
Can this convert decimal to binary?
Yes. Choose Decimal → Binary and a width. The page shows unsigned and signed representations separately and says when the integer is not representable at that width.
What is the difference between source width and target width?
For binary input, the number of entered digits is the source width and determines the raw signed two's-complement interpretation. The Target bit width selector controls only the zero extension, sign extension, or truncation preview. For example, source bits 1 mean unsigned 1 or signed -1 at one bit; targeting eight bits then shows 00000001 and 11111111 separately.
Does this convert text or binary-coded decimal?
No. This page handles one integer with up to 64 bits. Use Binary Translator for UTF-8 or ASCII text. Binary-coded decimal stores each decimal digit in a separate four-bit code and is outside this tool's scope.