Private browser utility / Developer

Two's Complement Converter

Runs entirely in your browser - no upload, no sign-up.

Live workspaceLocal processing
Two's complement converter
Conversion direction
Signed range: -128 to 127

Enter a whole number inside the selected signed range. Results update as you type.

Conversion result

Choose a width and enter a value to see its signed decimal, binary, hexadecimal, and calculation steps.

Share this tool
twos complement converter / browser utility
01 / Overview

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.

02

How to use

  1. 01
    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. 02
    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. 03
    Enter the value

    Type a decimal integer or an exact-width binary word. The converter validates the digits and reports overflow clearly.

  4. 04
    Read or copy the result

    Review the grouped binary, signed decimal, hexadecimal, unsigned value, and calculation steps, then copy the binary word.

03

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.

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.

FAQ

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.