onlinebinarytools logo

Negative binary decoder

World's simplest binary tool

This is a free online negative binary number decoder. Just load your encoded negative binaries in the input form and they will automatically get decoded to decimal numbers according to the selected negative binary representation method. It supports one's complement, two's complement, excess binary, sign bit, and base -2 representations. There are no ads, popups or nonsense, just an awesome negative binary converter. Load a negative binary – get a negative decimal. Created for developers by developers from team Browserling.
announcement heads up!
We just launched a new site – Online Fractal Tools – utilities for doing fractaly things. Check it out!
Negative Binary Representation
Select the binary representation of input numbers.
Decoding Explanations
Sign Bit Example: 111 → remove sign bit → 112 = -3.
One's Complement Example: 00 → invert → 112 = -3.
Two's Complement Example: 01 → minus one → invert → 112 = -3.
Decoding Explanations
Offset Binary Example: 001 → remove sign bit → minus one → invert → 112 = -3.
Base Minus Two Example: 1101 = (-2)3 + (-2)2 + 0 + (-2)0 = -3.
Naive Example: -11 = '-' + 112 = -3.
Negative binary decoder tool What is a negative binary decoder?
This browser-based utility converts negative binary values to negative integer values. This is the reverse operation of encoding a negative binary that converts a negative integer to its binary representation. This tool is able to decode six negative binary representation types – two's complement, one's complement, sign bit, offset binary, negative base two, and the naive scheme. To decode a binary number, it undoes the encoding process and performs the encoding steps in the reverse order. For example, in two's complement encoding the number is first inverted and then one is added to the result but in two's complement decoding, the same is done in the reverse order – first, one is subtracted and then the result is inverted. To decode a negative one's complement value, simply the inverse is taken as encoding and decoding in one's complement is just the bit invert operation. In the sign bit representation, this tool removes the most significant bit, which indicates the sign of the number and converts this number to base ten. The offset binary method (also known as excess code or biased representation) is almost the same as the two's complement method, but it has a sign bit at the beginning. Therefore, the tool first deletes the most significant bit and then applies the two's complement method on the number. Each output decimal number in these four representations has a "-" sign automatically appended so these representations don't work with positive decimal numbers. In base minus 2 representation, the decimal number x is immediately calculated by the formula x = a0(-2)n + a1(-2)n-1 + … + an(-2)0. The coefficients a0, a1, …, an are individual bits of the input binary number in base -2 representation. The last method is the easiest to decode. It's the naive method that creates negative binary numbers with the help of the "-" sign that's placed before an ordinary binary number. To decode this value, the binary number after the minus sign is converted to base ten and then the base ten number is displayed in the output together with the minus sign in front of it. Simple and easy!
Negative binary decoder examples Click to use
Decode 2's Complement
This example decodes seven negative binaries that had previously been encoded with the two's complement method. It subtracts one from each number and then inverts the bits. Decoding the first number, we get: 001 → 000 → 111, decoding the second number, we get: 0011 → 0010 → 1101, decoding the third number, we get: 01000 → 00111 → 11000, and so on. After decoding, the obtained values are converted to base ten and a minus sign is added at the beginning of each number. The first number: 1112 = -710, the second number: 11012 = -1310, the third number: 110002 = -2410, and so on.
001 0011 01000 011010 001101 0100011 0010111
-7 -13 -24 -38 -51 -93 -105
Required options
These options will be used automatically if you select this example.
Select the binary representation of input numbers.
Decode 1's Complement
In this example, we convert six padded negative binaries in one's complement representation to negative integers in the decimal base. To decode a one's complement value, it's first bitwise inverted (all bits are flipped) and then the result is converted to base ten with a minus sign before the value. One's complement method uses leading 1's to pad negative binaries. When finding the inverse value, 1's are replaced with 0's, thus padding doesn't affect the magnitude of the binary value. Let's take a look at the first input value. It's 111100, then when it's inverted, it becomes 000011, which is 3 in base ten, and a minus sign is added in front of it, so we get -3.
111100 111010 111000 110110 110100 110010
-3 -5 -7 -9 -11 -13
Required options
These options will be used automatically if you select this example.
Select the binary representation of input numbers.
Sign Bit Negatives
This example selects the sign bit representation method in the options. This method uses the high bit (most significant bit) to determine the sign of a value. If the high bit is 1, then it's a negative number; otherwise, it's a positive number. The input values in this example have also been prefixed with the binary prefix "0b" and padded to eight bits. To convert these values, the tool removes the binary prefix, removes padding, removes the most significant bit, and treats the remaining bits as regular binary numbers. It then converts them from the binary base to the decimal base and outputs them with a minus sign as all of them had the sign bit of 1.
0b100001011 0b100010110 0b100100001 0b100101100 0b100110111 0b101000010 0b101001101 0b101011000 0b101100011
-11 -22 -33 -44 -55 -66 -77 -88 -99
Required options
These options will be used automatically if you select this example.
Select the binary representation of input numbers.
Biased Representation
In this example, we decode six binary values that were earlier encoded using the offset binary (biased binary) representation scheme. The utility first removes the sign bit, which in this scheme is "0" and also removes the binary subscript postfix. Then it subtracts one, inverts the number, converts it to base ten, and adds the "-" sign. We can visualize the conversion algorithm for the first number: 00111₂ → (remove the first bit and ₂ postfix) → 0111 → (subtract one) → 0110 → (invert bits) → 1001 → (convert to decimal) → -9.
00111₂ 00101011₂ 0000000₂ 0000100111₂ 00000000000₂ 0010000101010₂
-9 -85 -64 -473 -1024 -3030
Required options
These options will be used automatically if you select this example.
Select the binary representation of input numbers.
Base Minus Two
This example uses an unusual base -2 and decodes numbers to base 10. To do this, it uses the formula x = a0(-2)n + a1(-2)n-1 + … + an(-2)0, where x is the number in base 10 and the coefficients a0, a1, …, an are the input bits. This formula and the bits uniquely express a negative number in base 10. Let's convert the first binary number 1101 together. We have the coefficients a0 = 1, a1 = 1, a2 = 0, a3 = 1, and when we put them in the formula, we get 1×(-2)3 + 1×(-2)2 + 0×(-2)1 + 1×(-2)0 = -8 + 4 + 0 + 0 = -4. So, 1101₂ is -4₁₀.
1101 111011 1111010100 1001000111 100000110100 111110001001000101
-3 -25 -300 -445 -2060 -90555
Required options
These options will be used automatically if you select this example.
Select the binary representation of input numbers.
Naive Numbers
In this example, we decode binary numbers that simply have a minus sign in front of them. This binary representation is the only one that humans can instantly understand. It doesn't modify the binary values and simply uses the regular "-" sign to create negative numbers. Therefore, to get a negative binary, we take the absolute binary value and add the "-" sign in front of it. If 111 is 7, then -111 is -7.
-111 -1010111 -1011111101 -1100110001111 -1101010000110001
-7 -87 -765 -6543 -54321
Required options
These options will be used automatically if you select this example.
Select the binary representation of input numbers.
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/decode-negative-binary?input=001%0A0011%0A01000%0A011010%0A001101%0A0100011%0A0010111&representation=twos-complement
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 find the number of high bits in binary values.
Quickly find the number of low bits in 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.
Generate a Binary Sequence
Create a list of increasing of decreasing binary numbers.
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.
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.
Pad Binary Values
Add signed or unsigned padding to binary numbers.
Truncate Binary Values
Drop leading or trailing bits and make a binary value shorter.