Two's Complement Calculator
Convert decimal, hex, or binary numbers to their two's complement binary representation.
Supports decimal, hex (0x...), and binary (0b...)
About this tool
Two's complement is the standard method for representing signed integers in binary computer systems. It allows a single binary representation to cover both positive and negative integers and simplifies CPU arithmetic circuits by making subtraction work the same as addition of a negated value. Understanding two's complement is fundamental to systems programming and computer science.
This tool converts decimal, hexadecimal, or binary numbers into their two's complement binary representation at a chosen bit width (8, 16, 32, or 64 bits). It shows you the binary layout, the unsigned interpretation, and the signed interpretation of the same bit pattern, making the relationship between signed and unsigned integers concrete and visual.
Two's complement is relevant whenever you're working with bit manipulation, low-level protocols, embedded systems, or debugging integer overflow and wrapping behavior. It's also a common topic in coding interviews and computer science courses, where being able to compute complements mentally or verify your work quickly is valuable.