Free Online Utility • Binary Studio • Base-2 Engine

Convert Binary to Negabinary

Convert positive or negative binary numbers into base -2 negabinary representation without needing any minus sign.

Formula & Quick Reference Base-2 Engine
Value = sum( d_k * (-2)^k ),  d_k in {0, 1}
10 = 16 - 8 + 4 - 2 = 11110_(-2) | -10 = 1010_(-2)
1_101_(-2)
-1_1011_(-2) = -2+1
10_1011110_(-2)
BASE-2 TO BASE -2
Negabinary Output

        
100% client-side exact Binary Engine Instant

Session Calculation Log

No entries recorded in this session yet.

How Convert Binary to Negabinary Works

Convert Binary to Negabinary transforms signed or two's complement binary integers into base -2 (negabinary) positional notation, which represents both positive and negative integers uniquely without a sign bit.

Binary arithmetic and base-2 encoding form the physical foundation of digital microprocessors, network packets, memory buffers, and cryptographic primitives. Every calculation in this utility runs directly inside your browser using exact JavaScript BigInt and typed-array pipelines, so arbitrary-length bitstreams, 128-bit addresses, and raw byte buffers never suffer from 53-bit IEEE floating-point truncation or server latency.

Repeated Euclidean Division by -2

While n != 0:
  rem = n mod (-2); n = trunc(n / -2)
  if rem < 0: rem += 2; n += 1
  prepend rem

Because powers of -2 alternate signs (+1, -2, +4, -8, +16, -32, ...), every integer in Z has one unique finite representation using only digits 0 and 1.

Worked Reference Examples

InputOutputStep / Bit Note
1010 (10)1111016 - 8 + 4 - 2 = 10
-1 (-1)11-2 + 1 = -1
-1010 (-10)1010-8 + 0 - 2 + 0 = -10

Practical Engineering Applications

Sign-Free Computer Arithmetic

Study alternative positional systems (used in experimental Polish computers like SKRZAT and BINEG).

Algorithmic & Olympiad Math

Verify base -2 solutions in competitive programming and Knuth TAOCP exercises.

Precision, Edge Cases & Best Practices

Switch Input Interpretation to Two's Complement if pasting fixed-width signed binary words where MSB=1 is negative.

All input parsing strips harmless formatting whitespace, underscores, or common prefixes such as 0b where applicable, while preserving exact bit order and padding width so outputs drop straight into C/C++, Rust, Verilog, VHDL, Python, and embedded firmware test harnesses.

Frequently Asked Questions

How can negabinary represent negative numbers without a minus sign?
Odd bit positions carry negative weights (-2, -8, -32, ...), so combining odd and even powers reaches every positive and negative integer uniquely.
What is -1 in negabinary?
11 in base -2, because 1×(-2)^1 + 1×(-2)^0 = -2 + 1 = -1.
Does this support arbitrarily large binary values?
Yes — BigInt computes exact base -2 representations of any size.