This 32-bit bitwise calculator runs one operation on unsigned 32-bit values. The operations are AND, OR, XOR, NOT, left shift, and logical right shift. AND, OR, and XOR take two values. NOT takes one value. A shift takes a value and a shift count. The width is unsigned 32-bit only. There is no signed mode and no 64-bit mode.
A value is a decimal integer from 0 through 4294967295 with no leading zero, or a 0x hexadecimal token, or a 0b binary token. 0 is valid. 08 is not, because a leading decimal zero is ambiguous. 0x00ff is valid because the zeros belong to the hex token, not to a decimal spelling. A negative value is an error. The page does not silently turn -1 into 4294967295. A float, an empty field, and a value above 4294967295 are errors. Invalid input clears the result. No partial bits stay on screen.
NOT inverts all 32 bits. NOT of 0 is 4294967295, hex ffffffff. NOT of ffffffff is 0. A left shift moves bits toward the high end and fills the low end with zeros, then keeps the low 32 bits. A logical right shift moves bits toward the low end and fills the high end with zeros. The high bit does not smear into the vacated positions. That is why 0x80000000 shifted right by 1 is 0x40000000, not a negative number and not a string of high ones.
A shift count is an integer from 0 through 31. Zero is a valid count and leaves the value unchanged. 32 or more is an error, including a hex or binary token that equals 32 or more. The page does not mask the count to five bits the way JavaScript shift operators do. The error text says so. The result is also not what C does on this machine, and it is not JavaScript’s signed right shift. The page does not call a flag mask safe or secure.
The output is three lines: the decimal value, eight lowercase hex digits, and 32 binary digits grouped in eights. Copy writes those three lines. When NOT is selected, the second field is hidden and is not read. When a shift is selected, the second label reads Shift count.
Nothing is sent off the page. The numbers are not stored, and the page does not run a shell command.
0b1111 AND 0x3 is decimal 3, hex 00000003. 1 OR 2 is decimal 3. 255 XOR 1 is decimal 254. NOT of 0 is decimal 4294967295, hex ffffffff, and binary 11111111 11111111 11111111 11111111. NOT of 0xffffffff is 0. A leftover second field is ignored while NOT is selected.
Left shift of 1 by 31 is decimal 2147483648, hex 80000000, binary 10000000 00000000 00000000 00000000. Logical right shift of 0x80000000 by 1 is decimal 1073741824, hex 40000000. The high bit became zero. Left shift of 0x10 by 0 stays 16. A shift count of 32, or of 0x20, is an error and does not become a shift of 0. -1 is an error and does not become 4294967295. 08 is an error because of the leading zero. 1.5 is an error because it is not an integer. 4294967296 is an error because it does not fit in 32 bits. 4294967295 is accepted.
The calculation stays in the browser. A result is the unsigned 32-bit value of the operation you chose. It is not a file mode, not a hash, and not a change of spelling for an integer in another base.
Unsigned 32-bit only. There is no signed mode and no 64-bit mode. A value is a decimal integer from 0 to 4294967295 with no leading zero, or a 0x hex token, or a 0b binary token. A negative value is an error and is not turned into 4294967295. NOT inverts 32 bits. A shift count must be an integer from 0 to 31. A shift of 32 or more is an error. This page does not mask the count to five bits the way JavaScript shift operators do. The right shift is logical and fills with zeros. The result is not what C does on this machine and not JavaScript’s signed right shift. A mask is not called safe or secure. Nothing is sent or stored.
JavaScript shift operators mask the count to five bits, so a count of 32 becomes a count of 0. This page does not do that. 32 or more is an error and the previous result is cleared.
It is an error. The page does not turn a negative into the unsigned pattern 4294967295. Type that unsigned value yourself if that bit pattern is what you want.
No. The right shift here is logical: vacated bits are filled with zeros. It is not JavaScript’s signed right shift, and it is not a claim about what C does on a particular machine.
No. The page prints the decimal, the 8-digit hex, and the 32 binary digits of one unsigned operation. It does not judge whether a flag mask is safe or secure.