Bits ⇄ Range
How large can n bits represent — unsigned/signed range and total count.
What it does: Computes the representable range from a bit width, or reverse-looks up the bit width needed.
When to use it: Choosing a variable type, fixing a field width, or guarding against overflow.
MEANS Signed has half the positive range of unsigned (the top bit is the sign), but one extra value on the negative side.
No history yet. Each calculation is automatically saved to this device.
How to use the bits-to-range calculator
Just enter the bit width.
- 01
Enter the bit width
1–64 bits, for example
8,16,32. - 02
Click Calculate
Get the representable unsigned and signed (two's complement) ranges and the total count.
- 03
Use it in reverse
You can also enter a value below to find "the minimum number of bits needed to hold it".
Common bit-width ranges
Unsigned 0…2ⁿ−1; signed −2ⁿ⁻¹…2ⁿ⁻¹−1.
| Bit width | Unsigned max | Signed range |
|---|---|---|
| 8 | 255 | −128 … 127 |
| 16 | 65,535 | −32,768 … 32,767 |
| 32 | 4,294,967,295 | −2.1e9 … 2.1e9 |
| 64 | 1.8e19 | −9.2e18 … 9.2e18 |
Powers of 2, exact with BigInt.
Common questions, answered in 3 minutes
Why is the signed maximum about half the unsigned maximum?
A signed value uses the top bit as a sign bit, leaving one fewer value bit, so the positive maximum is about half that of unsigned.
How many numbers can 8 bits represent?
2⁸ = 256: unsigned 0–255, or signed −128–127.
Why does signed have one extra negative number?
In two's complement, 0 takes only one encoding, and the spare one goes to −2ⁿ⁻¹, so there is one more negative number than positive.
Standards and sources referenced by this tool
| Item | Value / Formula | Source |
|---|---|---|
| Range | Unsigned 2ⁿ−1 / signed ±2ⁿ⁻¹ | Binary representation |
Exact with BigInt, no external API.