51K

# Binary subtractor

World's simplest binary tool
Free online binary difference calculator. Just load your binary values and they will automatically get subtracted from the first value. There are no ads, popups or nonsense, just an awesome binary subtractor. Load binary values – get binary difference. Created for developers by developers from team Browserling.
announcement check out our new project!
We just created something new for all science fans – SCIURLS – a neat science news aggragator. Check it out!
Binary Representation
Represent a negative binary as an inverted binary plus one.
Represent a negative binary as an inverted binary (flip all bits).
Set leading bit to 0 for a positive binary and 1 for a negative binary.
Similar to two's complement, but with the first bit flipped.
Simply use the - sign prefix for a negative binary.
Input and Output Format
Specify the input separator.
Adjust base indicator. (Prefix or suffix.)
Running Difference and Decimals
Show how the results are computed step by step.
Print the decimal number in parentheses for easier understanding.

## Binary subtractor examples

Click to use
Subtract Two Binary Numbers
In this example, we find the difference of two binary numbers 1100100 (100 in decimal) and 10100 (20 in decimal). We enter each number on a new line and adjust the separator to "\n". As a result, we get the binary value 1010000, which is 80 in decimal.
1100100 10100
1010000
Required options
These options will be used automatically if you select this example.
Simply use the - sign prefix for a negative binary.
Specify the input separator.
Adjust base indicator. (Prefix or suffix.)
Show how the results are computed step by step.
Print the decimal number in parentheses for easier understanding.
Running Difference
In this example, we subtract three binary numbers and display each subtraction step. To better understand the results, we have activated the "Show Decimal" option as well as "Human Subtraction" method. Thus, we see that 10000₂ - 1010₂ = 110b₂ (6₁₀) and 110₂ - 1000₂ = -10b₂ (-2₁₀). The human subtraction method simply adds a minus sign before positive binary numbers to make them negative.
10000 1010 1000
10000b (16) 110b (6) -10b (-2)
Required options
These options will be used automatically if you select this example.
Simply use the - sign prefix for a negative binary.
Specify the input separator.
Adjust base indicator. (Prefix or suffix.)
Show how the results are computed step by step.
Print the decimal number in parentheses for easier understanding.
Two's Complement Arithmetic
This example uses the two's complement signed number representation. In this encoding scheme, a negative number is the bit-inverse of the positive number plus one. The example subtracts eight values from the first one and displays partial differences on every line. It also pads positive values with zeros and negative values with ones to the length of 6 and prints the corresponding decimal values in parentheses.
1000 1 10 11 100 101 110 111 1000
001000 (8) 000111 (7) 000101 (5) 000010 (2) 111110 (-2) 111001 (-7) 110011 (-13) 101100 (-20) 100100 (-28)
Required options
These options will be used automatically if you select this example.
Represent a negative binary as an inverted binary plus one.
Specify the input separator.
Adjust base indicator. (Prefix or suffix.)
Show how the results are computed step by step.
Print the decimal number in parentheses for easier understanding.
One's Complement Arithmetic
In this example, we subtract 1 from the number 11 (3 in decimal) eight times and print intermediate differences along the way. The differences are encoded using the one's complement arithmetic. In this numeral system, negative numbers are bit-complement of the positive numbers. After four steps, we reach the first negative number -1₁₀, which is a bit-inverse of 1 and equals 0₂. With 8-bit padding, this number is 11111110₂. Similarly, -2₁₀ is the inverse of 2₁₀ and equals 01₂ or 11111101₂ with padding.
11 1 1 1 1 1 1 1 1
00000011 (3) 00000010 (2) 00000001 (1) 00000000 (0) 11111110 (-1) 11111101 (-2) 11111100 (-3) 11111011 (-4) 11111010 (-5)
Required options
These options will be used automatically if you select this example.
Represent a negative binary as an inverted binary (flip all bits).
Specify the input separator.
Adjust base indicator. (Prefix or suffix.)
Show how the results are computed step by step.
Print the decimal number in parentheses for easier understanding.
Sign and Magnitude Representation
This example subtracts five even numbers, using the signed magnitude representation (SMR). This encoding uses the first bit as the + or - sign indicator. If the most significant bit (MSB) is 0, then it's a + sign and the number is positive. If the MSB is 1, then it's a - sign and the number is negative. The binaries in this example are separated by the "-" character and the running difference and the display decimal value options are enabled. When calculating the third difference, the number becomes negative -4. In SMR -4 is 1100₂. As you can see, 100₂ is 4 and adding a sign bit 1 in front of it makes it 1100₂, which is -4.
110-100-10-100-110
110 (6) 10 (2) 0 (0) 1100 (-4) 11010 (-10)
Required options
These options will be used automatically if you select this example.
Set leading bit to 0 for a positive binary and 1 for a negative binary.
Specify the input separator.
Adjust base indicator. (Prefix or suffix.)
Show how the results are computed step by step.
Print the decimal number in parentheses for easier understanding.
Biased Representation
This example subtracts a bunch of comma-separated binary values using the excess binary (biased binary) representation. In this digital encoding scheme, negative binary values are equal to inverted positive values plus one and with the first bit inverted one more time. This scheme is the same as applying two's complement and then inverting the first bit of the result. In this encoding, positive numbers start with 1 and negative numbers start with 0 but the padding is still 0 for positive numbers and 1 for negative. When using padding, its length sets the k value. In this example, padding is 4 so k is 2padding = 16. If padding is not set, then each number has the minimal power of two k that it can fit in.
1010, 1000, 110, 100, 10, 110
11010₂ (10) 10010₂ (2) 01100₂ (-4) 01000₂ (-8) 00110₂ (-10) 00000₂ (-16)
Required options
These options will be used automatically if you select this example.
Similar to two's complement, but with the first bit flipped.
Specify the input separator.
Adjust base indicator. (Prefix or suffix.)
Show how the results are computed step by step.
Print the decimal number in parentheses for easier understanding.
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!
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 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
Binary Editor
View and edit binary values in your browser.
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 Ternary
Convert binary numbers to ternary numbers.
Convert Ternary to Binary
Convert ternary numbers to binary numbers.
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.
Find the sum of set bits in binary numbers.
Swap Binary Bits
Swap pairs of adjacent bits in a binary number.
Generate a Binary Sequence
Create a list of increasing of decreasing binary numbers.
Generate an Alternating Binary Sequence
Create a binary number with alternating bits.
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 a Binary Number to Floating Point
Decode a binary number to a floating point number.
Binarize an Image
Convert any image to binary colors.
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.
Duplicate Bits in Bytes
Replace each bit with two bits in each byte.
Convert Bits to Bytes
Group bits together to create bytes.
Convert Bytes to Bits
Expand bytes into individual bits.
Split Binary Values
Split a binary number into smaller binary numbers.
Join Binary Values
Join multiple smaller binary numbers into a single binary.
Slice Binary Values
Extract a part of a binary number.
Replace Binary Values
Substitute ones and zeros with any other values.
Truncate Binary Values
Drop leading or trailing bits and make a binary value shorter.
Randomly Flip Binary Bits
Introduce random errors in binary values.
Color Binary Numbers
Print the same binary numbers in the same colors.
Color Binary Bits
Use two different colors for binary zeros and ones.
Compare Binary Streams
See the difference between two binary blobs of bytes.
Visualize Binary Operations
Create visualizations of and, or, xor, not binary ops.
Create a Binary ZigZag
Make binary bits go in a zigzag.
Create a Binary Spiral
Make binary bits go in a spiral.
Create a Binary Circle
Make binary bits go in a circle.
Create a Binary Square
Create a sqaure shape from binary bits.
Generate Random Bits
Create a sequence of random binary bits.
Generate Random Nibbles
Create a sequence of random binary nybbles.
Generate Random Bytes
Create a sequence of random binary octets.
Generate Random Words
Create a sequence of random binary words.
Generate Random Double Words
Create a sequence of random binary long words.
Generate Binary Look-and-Say
Create a look-and-say sequence in base-2.
RLE-encode a Binary Number
Apply run length encoding algorithm on a binary sequence.
RLE-decode a Binary Number
Decode a previously RLE-encoded binary sequence.
Spell a Binary Number
Spell a binary number in words.
Analyze Binary Data
Print statistics of the input binary values.