2's Complement Calculator
Convert decimal numbers to binary 2's complement representation and vice versa. Supports 8-bit, 16-bit, and 32-bit formats.
Was this calculator helpful?
How to use this tool?
How to Use the 2's Complement Calculator
This calculator converts between decimal integers and their 2's complement binary representation. Follow these steps:
- Select Conversion Direction – Choose Decimal to 2's Complement Binary or 2's Complement Binary to Decimal from the dropdown.
- Enter Input – For decimal, type an integer (e.g.,
-42or127). For binary, type only 0s and 1s (e.g.,11010110). - Choose Bit Length – Select 8, 16, or 32 bits. This defines the range and padding of the result.
- Click "Calculate" – The result appears below, along with step-by-step details showing the conversion process.
Important: Decimal values must be within the range for the selected bit length (e.g., 8-bit: -128 to 127). Binary input is automatically padded to the chosen bit length.
Previous Results
| Result | Inputs | Date |
|---|
Frequently Asked Questions
Two's complement is a mathematical operation on binary numbers used to represent signed integers. It is the most common method of representing negative integers in computers.
For a positive number, just write the binary representation. For a negative number, invert all bits of the positive binary representation and add 1.
For 8 bits, the range is -128 to 127.