One's Complement Calculator - Binary, Decimal and Hex

Your details

Choose the base of the number you are entering. Decimal is the standard base-10 system; binary uses only 0s and 1s; hexadecimal uses digits 0-9 and letters A-F.
Enter the number to convert. For decimal, type a non-negative integer. For binary, type 0s and 1s only. For hex, use digits 0-9 and A-F (case-insensitive, 0x prefix optional).
The total number of bits used to represent the number. 8-bit is standard for single bytes; 16-bit covers short integers; 32-bit covers most modern integer types.
One's complement (binary)
1101 0101

The bitwise NOT of the input, padded to the chosen bit width.

One's complement (decimal)213
One's complement (hex)D5
Input as binary0010 1010
Input as decimal42
Input as hex2A

One's complement of 42 in 8 bits is 213 (1101 0101).

  • In 8-bit one's complement, the complement of 42 is 213 (0xD5).
  • Adding the original and its complement always gives 255 (all 1s), which equals 2^8 - 1.
  • One's complement is simply bitwise NOT: every 0 becomes 1 and every 1 becomes 0.
  • 8-bit one's complement can represent signed integers from -127 to +127 (it has two zeros: 0000 0000 and 1111 1111).

Next stepFor modern signed-integer arithmetic, two's complement (add 1 to one's complement) is the standard because it eliminates the double-zero problem.

= Powered by OnlyCalculators