Skip to content

Arithmetic on the numbers you type

Combine two integers with bits

AND, OR, and XOR are shown in decimal. AND is also shown in hex. The left value is shifted by one in each direction.

The integers are exact. They are not clipped to 32 bits.

The work stays in this tab.

This tool runs in your browser. Turn on JavaScript to use it.

Bitwise

The sample is fixed. It uses the same rule as the form.

Left
6
Right
3
AND
2
OR
7
XOR
5
AND hex
2
<< 1
12
>> 1
3

How to use it

  1. 1Fill in the fields.
  2. 2Read the result.
  3. 3Copy the line you need.

Good to know

  • There is no floating-point bitwise mode.
  • This page does not upload the text.
  • Text longer than one hundred thousand characters is rejected.

Questions

Does the result leave this browser?

No. The calculation finishes in the current tab.

What does this page leave out?

There is no floating-point bitwise mode.

What if the input is huge?

Past one hundred thousand characters, the page stops and asks you to shorten it.

Related tools

  • Convert binary, octal, decimal, and hex

    255, 0xFF, and 11111111 are one integer written three ways. This page keeps that integer exact and shows the other spellings beside the field you edit.

  • Calculate chmod permissions

    chmod talks in octal and in letters. This page shows both for the same bits, including the extra digit for setuid, setgid, and the sticky bit.

  • Encode text as hexadecimal

    Hex is a way to show raw bytes. This page encodes text as UTF-8 first, then prints each byte. Decoding accepts only an even number of digits and rejects bytes that are not UTF-8.