← ← All Tools

🔄 Binary Complement Calculator

Visualize sign-magnitude, ones' complement and two's complement for integers with 8/16/32/64-bit widths, dec/bin/hex I/O, step-by-step derivation, color-coded bit grid and boundary presets

💡 All computation runs locally in your browser — input data is not uploaded by the tool.
Bit Width
Input Format

8-bit signed range: -128 to 127

Step-by-step Derivation
Enter an integer to see the derivation steps.
Quick Reference
Bits Two's comp min Max Sign-mag min
8-128127-127
16-3276832767-32767
32-21474836482147483647-2147483647
64-92233720368547758089223372036854775807-9223372036854775807

Sign-magnitude: MSB is the sign bit (0=positive, 1=negative), remaining bits are the absolute value in binary.

Ones' complement: Same as sign-magnitude for positive numbers; for negative numbers, flip all value bits.

Two's complement: Same as sign-magnitude for positive numbers; for negative numbers, ones' complement + 1. Modern computers universally use two's complement for signed integers.

Online sign-magnitude, ones' complement and two's complement calculator for 8/16/32/64-bit signed integers. Features decimal/binary/hex triple-format I/O, step-by-step derivation, color-coded bit grid (sign bit, flipped bits, carry bits), and MAX/MIN/-1/0 boundary presets. All computation runs locally in your browser — no server required.