Two's Complement Converter — Signed Binary & Hex at 8/16/32/64-bit
See any signed integer as two's-complement binary and hex at 8, 16, 32 or 64-bit width, with the signed and unsigned interpretations side by side and the invert-and-add-one steps for negatives shown. Type decimal, hex or binary — updates live, all in your browser.
How to Use
- Pick the bit width — 8, 16, 32 or 64 bits.
- Type a value; choose whether you are typing decimal, hexadecimal or binary.
- Read off the two's-complement binary and hex, plus the signed and unsigned meaning of those exact bits.
- For a negative number, the worked steps show |n| in binary, the inverted (one's-complement) bits, then +1.
Signed numbers as a fixed-width pattern of bits
Computers do not store a minus sign — they store a fixed number of bits, and two’s complement is the convention that decides which bit patterns mean negative numbers. The trick is simple: to make −n, take the bit pattern for n, flip every bit, and add one. The pay-off is that the most-significant bit ends up acting as a sign bit (1 means negative), ordinary binary addition then works for positive and negative values with no special handling, and there is exactly one representation of zero. This tool shows your value’s two’s-complement binary and hex at a width you choose, and crucially gives you both readings of those bits: the signed interpretation and the unsigned one, which diverge the moment the top bit is set.
Why width matters, and what overflow looks like
The same number occupies a different pattern depending on whether it lives in an 8-bit byte or a 64-bit word, and each width can only hold a limited range. A w-bit signed integer spans −2^(w−1) … 2^(w−1)−1; the same bits read unsigned span 0 … 2^w−1. Push past the signed range — say storing 200 in a signed byte whose maximum is 127 — and the value wraps: the bits become 11001000, which still reads 200 unsigned but −56 signed. That is integer overflow, and the tool flags it while still showing the exact wrapped bits. All arithmetic here uses JavaScript BigInt, so 64-bit values such as −1 = 0xFFFFFFFFFFFFFFFF are exact rather than rounded.
Quick reference
About the Two's Complement Converter — Signed Binary & Hex at 8/16/32/64-bit
Meet the Two's Complement Converter — Signed Binary & Hex at 8/16/32/64-bit: a free, no-fuss tool for everyday tasks with nothing to install and no sign-up. See any signed integer as two's-complement binary and hex at 8, 16, 32 or 64-bit width, with the signed and unsigned interpretations side by side and the invert-and-add-one steps for negatives shown. Type decimal, hex or binary — updates live, all in your browser.
How it works
Type a value, then pick what you want to change it into. The answer appears straight away. It all happens on your own device, so it is fast and nothing you type is sent away. Just check that you picked the right “from” and “to” so you get the answer you wanted.
Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.
Frequently Asked Questions
What is two's complement?
It is the standard way computers store signed whole numbers. The negative of a value is formed by inverting every bit of its magnitude and adding one. The result is that the most-significant bit acts as a sign bit, ordinary binary addition works for both positive and negative numbers with no special cases, and there is a single representation of zero.
How do I work out the two's complement of a negative number by hand?
Write the magnitude in binary at your chosen width, flip every 0 to 1 and every 1 to 0 (that is the one's complement), then add 1. For example −5 in 8 bits: 5 = 00000101, invert → 11111010, add 1 → 11111011 (0xFB). The "steps" panel does exactly this.
Why do the signed and unsigned values differ?
They are two readings of the same bits. If the top bit is 0 they agree. If the top bit is 1, the unsigned reading just adds up all the bits as a positive number, while the signed reading subtracts 2ⁿ so the value comes out negative. 0xFF is 255 unsigned but −1 signed in 8 bits.
What range fits in each width?
A w-bit signed integer covers −2^(w−1) … 2^(w−1)−1, and unsigned 0 … 2^w−1. So 8-bit signed is −128…127, 16-bit −32768…32767, 32-bit ±~2.1 billion, 64-bit ±~9.2 quintillion. Enter a number outside the signed range and the tool flags the overflow (the bits still wrap around exactly).
Is anything uploaded?
No. Everything is computed in your browser with JavaScript using BigInt, so even 64-bit values are exact and nothing is sent to a server.
How do I use the Two's Complement Converter — Signed Binary & Hex at 8/16/32/64-bit?
Just type or paste your value. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Reading register & memory values
Decide whether a hex word like 0xFFFFFFF6 is a small negative (−10) or a huge unsigned value, at the exact width of the register.
Embedded & firmware work
Check how an int8_t or int16_t will store a value and what it wraps to on overflow before it bites you.
Learning computer arithmetic
See the invert-and-add-one method spelled out and watch the sign bit decide the signed interpretation.
Debugging integer overflow
Confirm what 200 stored in a signed byte actually becomes (−56) versus its unsigned reading (200).
Last updated: