Discrete Mathematics & Graph Theory
Calculate the two's complement representation of binary numbers. Perfect for computer science, digital logic design, and discrete mathematics.
Enter a decimal number (e.g., -5) or binary with 0b prefix (e.g., 0b1010)
Common bit widths: 8-bit (byte), 16-bit (short), 32-bit (int)
Try these pre-configured examples to understand two's complement conversion
Converting positive decimal 5 to 8-bit two's complement
Number: 5
Bit Width: 8 bits
Format: decimal
Converting negative decimal -5 to 8-bit two's complement
Number: -5
Bit Width: 8 bits
Format: decimal
Converting binary 1010 to 16-bit two's complement
Number: 0b1010
Bit Width: 16 bits
Format: binary
Converting maximum positive value for 32-bit signed integer
Number: 2147483647
Bit Width: 32 bits
Format: decimal