onlinebinarytools logo

Binary to negabinary converter

World's simplest binary tool

Free online binary to negabinary converter. Just load your binary numbers and they will automatically get converted to base -2. There are no ads, popups or nonsense, just an awesome negabinary encoder. Load a binary – get a negabinary. Created for developers by developers from team Browserling.
we're on twitter! tweet tweet
Love what we do? You can follow us on Twitter for updates!
Power Series
Expand the negabinary as a power series of -2.
Decimal Interpretation
Print the negabinary value in the decimal base 10.
Display decimal value works only when the Show Full Sum option is off.
Binary to negabinary converter tool What is a binary to negabinary converter?
This browser utility converts binary numbers to negabinary numbers. It takes a value in base 2 and returns this value in base -2. Let's review how to convert a base 10 number to the binary base. To find a decimal number's representations in a binary base, write it as a sum of powers of two and then copy the coefficients before the powers. The coefficients create the binary number. Let's do it for the number 6 as an example: 6 = 1×(-2)2 + 1×(-2)1 + 0×(-2)0. The coefficients are 110, therefore 610 = 1102. The negabinary numeral system uses the same sum formula to convert a number, except instead of powers of two, it's decomposed as powers of negative two. For the number 6, it looks like this: 6 = 1×(-2)4 + 1×(-2)3 + 0×(-2)2 + 1×(-2)1 + 0×(-2)0. Now, extracting the coefficients, we get 610 = 11010-2. The biggest advantage of the negabinary system is that it can express negative numbers without using a special sign bit or a special signed number representation, such as two's complement or offset binary (see encode negative binary tool). Base -2 uses the same decomposition formula. For example, -6 can be decomposed as 1×(-2)3 + 1×(-2)2 + 1×(-2)1 + 0×(-2)0 and from the coefficients we find that -610 = 1110-2. An interesting fact about the negabinary base is that positive numbers have an odd number of bits and negative ones have an even number of bits. This tool can also show the number representation formula in base -2 and print the decimal value next to the binary. To convert multiple numbers, enter each of them on a new line and use the "-" sign to work with negative binaries. Simple and easy!
Binary to negabinary converter examples Click to use
Negative and Positive Numbers
In this example, we convert four numbers from the binary base to the negabinary base. We also show their decimal values so that they were easier to understand. The second and fourth numbers in the input are negative because they start with the minus sign. In the output, there's no minus sign as it's not needed in the negabinary base because the base is made out of a sum of powers of -2 so the sign value is included in the base itself.
1001 -1101 11101 -111010001
11001 (9) 110111 (-13) 1101101 (29) 1001110011 (-465)
Required options
These options will be used automatically if you select this example.
Expand the negabinary as a power series of -2.
Print the negabinary value in the decimal base 10.
Negabinary Sum
This example finds the representation formulas for six base -2 binaries and prints the full sums. Positive numbers have an odd number of addends in the sum and negative numbers have an even number of addends. This is simply because the largest power dominates the entire sum. If the number of terms is odd, then the top power is positive and the entire sum is positive, if the number of terms is an even number, then the top power is negative and the entire sum is negative.
1 -10 11 110 -1001 1111
1×(-2)⁰ 1×(-2)¹ + 0×(-2)⁰ 1×(-2)² + 1×(-2)¹ + 1×(-2)⁰ 1×(-2)⁴ + 1×(-2)³ + 0×(-2)² + 1×(-2)¹ + 0×(-2)⁰ 1×(-2)³ + 0×(-2)² + 1×(-2)¹ + 1×(-2)⁰ 1×(-2)⁴ + 0×(-2)³ + 0×(-2)² + 1×(-2)¹ + 1×(-2)⁰
Required options
These options will be used automatically if you select this example.
Expand the negabinary as a power series of -2.
Print the negabinary value in the decimal base 10.
Pro tips Master online binary tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinebinarytools.com/convert-binary-to-negabinary?input=1001%0A-1101%0A11101%0A-111010001&show-representation-sum=false&show-decimal=true
All binary tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly convert ASCII characters to binary numbers.
Quickly convert binary numbers to ASCII characters.
Quickly convert UTF8 characters to binary bits.
Quickly convert binary bits to UTF8 characters.
Quickly generate random binary values.
Quickly create an image from a binary number.
Quickly convert binary numbers to octal numbers.
Quickly convert octal numbers to binary numbers.
Quickly convert binary numbers to decimal numbers.
Quickly convert decimal numbers to binary numbers.
Quickly convert binary numbers to hexadecimal numbers.
Quickly convert hexadecimal numbers to binary numbers.
Quickly convert octal values to BCD values.
Quickly convert BCD values to octal values.
Quickly convert decimal values to BCD values.
Quickly convert BCD values to decimal values.
Quickly convert hex values to BCD values.
Quickly convert BCD values to hex values.
Quickly convert an IP address to a binary IP address.
Quickly convert a binary IP address to a human readable IP.
Quickly convert an IPv6 address to a binary IPv6 address.
Quickly convert a binary IPv6 address to a human readable IPv6.
Quickly convert a string to binary values.
Quickly convert binary values to a string.
Quickly convert binary numbers to reflected binary numbers.
Quickly convert reflected binary numbers to binary numbers.
Quickly convert octal numbers to reflected binary numbers.
Quickly convert reflected binary numbers to octal numbers.
Quickly convert decimal numbers to reflected binary numbers.
Quickly convert reflected binary numbers to decimal numbers.
Quickly convert hexadecimal numbers to Gray code.
Quickly convert Gray code to hexadecimal numbers.
Quickly calculate the sum of a bunch of binary values.
Quickly calculate the difference of a bunch of binary values.
Quickly calculate the product of a bunch of binary values.
Quickly convert a negative number to a binary representation.
Quickly convert a negative binary number to a decimal number.
Quickly convert base 2 numbers to base -2.
Quickly calculate bitwise AND of a bunch of binary values.
Quickly calculate bitwise NAND of a bunch of binary values.
Quickly calculate bitwise OR of a bunch of binary values.
Quickly calculate bitwise NOR of a bunch of binary values.
Quickly calculate bitwise XOR of a bunch of binary values.
Quickly calculate bitwise XNOR of a bunch of binary values.
Quickly calculate bitwise NOT of a bunch of binary values.
Quickly invert bits of binary numbers.
Quickly reverse the order of bits in binary numbers.
Quickly convert plain text to binary values.
Quickly convert binary numbers to plain text.
Quickly randomize the order of bits in binary numbers.
Quickly rotate bits in binary numbers to the left or right.
Quickly shift bits of a binary number to the left.
Quickly shift bits of a binary number to the right.
Coming soon These binary tools are on the way
Create a File from Binary Values
Convert binary numbers to a binary file.
Binary Dump a File
Create a binary dump of files in your browser.
Convert Binary to Arbitrary Base
Convert binary values to any base (up to base 64).
Convert Binary to Roman Number
Convert binary numbers to Roman numerals.
Convert Roman Number to Binary
Convert Roman numerals to binary values.
Binary Sheffer Stroke
Calculate bitwise sheffer stroke operator of binary values.
Convert Binary to BCD
Encode every binary bit as a binary coded decimal.
Convert BCD to Binary
Decode binary coded decimals to binary bits.
Divide Binary Numbers
Perform division operation on several binary numbers.
Rotate a Binary Right
Rotate bits of a binary number to the right.
Rotate a Binary Left
Rotate bits of a binary number to the left.
Extract Bits from Binary Numbers
Extract n-th bit from a binary number.
Count Number of Zeroes
Count number of 0 bits in a binary number.
Count Number of Ones
Count number of 1 bits in a binary number.
Calculate Parity
Count parity of a binary number.
Convert EBCDIC to Binary
Convert EBCDIC characters to binary values.
Convert Binary to EBCDIC
Convert binary bits to EBCDIC symbols.
Swap Binary Endianness
Change endianness of a binary number.
Convert Little Endian Binary to Big Endian Binary
Convert a binary number from little endian to big endian.
Convert Big Endian Binary to Little Endian Binary
Convert a binary number from big endian to little endian.
Convert a Floating Point Number to Binary
Find the binary representation of a floating point number.
Convert Binary Values to a Bitmap
Convert a binary string to a bitmap image.
Convert a Bitmap to Binary Numbers
Convert a bitmap image to zeros and ones.