---
title: "Two's Complement Converter With Steps"
description: "Convert signed decimal numbers to two's-complement binary and back at 4, 8, 16, 32, or 64 bits, with exact hex and calculation steps."
url: https://candoya.com/tools/twos-complement-converter/
locale: en
type: browser-tool
---

# Two's Complement Converter

Category: [Developer](https://candoya.com/tools/dev/)

## What is a two's complement converter?

A two's complement converter translates signed decimal integers into the fixed-width binary format computers use, or decodes a binary word back to decimal. Choose 4, 8, 16, 32, or 64 bits to see the exact binary, hexadecimal, unsigned value, sign bit, valid range, and calculation steps.

This converter works in both directions and updates as you type. It uses exact integer arithmetic in your browser, so a 64-bit value never passes through JavaScript floating-point numbers or loses low-order bits. Spaces and underscores are accepted in binary input for easier reading.

## How to use it

1. **Choose a direction** - Select decimal to two's complement to encode a signed integer, or two's complement to decimal to decode a bit pattern.
2. **Set the bit width** - Pick 4, 8, 16, 32, or 64 bits. The selected width determines the signed range and how the leading bit is interpreted.
3. **Enter the value** - Type a decimal integer or an exact-width binary word. The converter validates the digits and reports overflow clearly.
4. **Read or copy the result** - Review the grouped binary, signed decimal, hexadecimal, unsigned value, and calculation steps, then copy the binary word.

## Who it's for

- **Systems developers** checking signed values in registers, memory dumps, and binary protocols.
- **Embedded engineers** translating sensor readings and device fields stored as fixed-width signed integers.
- **Computer science students** verifying invert-and-add-one exercises and learning why bit width changes the answer.
- **Security and network analysts** interpreting hexadecimal bytes and signed fields without 32-bit rounding errors.

## Expert note

Bit width is part of the value: 1111 means -1 as a 4-bit word but +15 when zero-extended to 8 bits. This tool requires the exact selected width when decoding so it never guesses the missing sign-extension bits.

## Frequently asked questions

### Is this two's complement converter free?

Yes. The converter is free to use with no sign-up, download, or conversion limit. It supports the common 4, 8, 16, 32, and 64-bit signed integer widths.

### Is my number uploaded anywhere?

No. Every calculation runs locally in your browser. The decimal or binary values you enter are not uploaded to a server, which makes the tool suitable for private register values, memory dumps, and protocol fields.

### What is the largest number the converter supports?

At 64 bits, the signed range is -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807. The converter uses BigInt for exact arithmetic, so those boundary values and every integer between them are converted without rounding.

### How do you convert a negative decimal to two's complement?

Write the positive magnitude in the chosen width, invert every bit, then add one. For example, 42 is 00101010 at 8 bits; inverting gives 11010101, and adding one gives 11010110, the 8-bit encoding of -42.

### How do you convert two's complement binary to decimal?

If the leading bit is 0, read the word as ordinary binary. If it is 1, read the unsigned value and subtract 2 raised to the bit width. For 11010110 at 8 bits, 214 minus 256 equals -42.

### Why does bit width matter in two's complement?

The most significant bit carries a negative weight and its position depends on the width. An 8-bit word spans -128 through 127, while a 16-bit word spans -32,768 through 32,767. A shorter negative word must be sign-extended with leading 1s to preserve its value.

### Can the converter show hexadecimal two's complement?

Yes. Every valid result includes the fixed-width hexadecimal word. For example, -42 at 8 bits is binary 11010110 and hexadecimal D6. The converter also shows the unsigned interpretation, which is 214 in this example.

## Related tools

- [Number Base Converter](https://candoya.com/tools/number-base-converter/)
- [IEEE 754 Float Converter](https://candoya.com/tools/ieee-754-float-converter/)
- [IPv4 Subnet Calculator](https://candoya.com/tools/ipv4-subnet-calculator/)
- [Data Storage Converter](https://candoya.com/tools/data-storage-converter/)
- [Base64 Encode and Decode](https://candoya.com/tools/base64-encode-decode/)

---

*Markdown edition of <https://candoya.com/tools/twos-complement-converter/>, published for AI agents and other automated readers. Index of key pages: <https://candoya.com/llms.txt>.*
