All Tools
T

Two's Complement Calculator

Convert between signed decimal integers and exact-width two's complement binary without silent padding, wrapping, or truncation.

Bit width

Preset widths only. Binary input must match the selected width exactly after normalization.

Signed decimal
Enter a whole number from the selected signed range.

Allowed range at 8 bits: -128 to 127.

Binary (two's complement)
Accepts optional 0b, spaces, and underscores before validation.

After normalization, the bit string must be exactly 8 bits. Shorter input is rejected instead of padded.

Enter a decimal or binary value to compute signed, unsigned, and hexadecimal views.
Derived outputs
Machine-readable values only. Copy buttons use the plain ungrouped value.
Results appear here after a valid input. Out-of-range decimals and wrong-length binary values hard-fail instead of wrapping.
Signed range
Fixed-width two's complement values always depend on the active bit width.

Min

-128

Max

127

Fits selected width

Waiting for input

Signed range rule: -2^7 through 2^7 - 1. The leading bit contributes negative weight.

Special cases
Two values deserve extra attention in two's complement math.
Valid inputs will call out the special zero case and the minimum negative value when they apply.