Flip bits with a mask
XOR with 1 flips a bit and XOR with 0 leaves it alone, so the mask 11110000 inverts the high four bits.
11001010 ⊕ 11110000
XOR two or more inputs of any length: binary, decimal, hex, Base64, ASCII or files. Everything is computed in your browser.
Type or paste two inputs and the result appears here, or load an example.
The inputs lined up column by column. 0 zero padding k repeated input
Nothing to show yet.
XOR with 1 flips a bit and XOR with 0 leaves it alone, so the mask 11110000 inverts the high four bits.
11001010 ⊕ 11110000
Numbers are XORed bit by bit. The breakdown shows the bits: 1100 ⊕ 1010 = 0110.
12 ⊕ 10 = 6
A key split into components, each held by a different person, is rebuilt by XORing all of them.
8B3F… ⊕ 5E92… ⊕ C4D7…
The short key repeats across the message. XOR the result with the same key and you get the message back.
attack at dawn ⊕ key
XOR (exclusive or) compares two bits and gives 1 when they differ and 0 when they match. Longer inputs are lined up and XORed bit by bit.
| A | B | A ⊕ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Anything XORed with itself is zero, and XORing twice with the same value undoes the first XOR: (a ⊕ k) ⊕ k = a. That is why XOR shows up in ciphers, checksums, parity and key splitting.
With three or more inputs the result is A ⊕ B ⊕ C …, and the order doesn’t matter. An empty input is left out, so a single input is simply shown in the output format: put hex in Input A, choose ASCII, and the page works as a converter.
: - _ , . and 0b prefixes are ignored.0x or \x prefixes are ignored.+ / or the URL-safe one with - _, with or without = padding. Spaces and line breaks are ignored.When the inputs aren’t the same length, choose how to line them up. Every shorter input is treated the same way. With 1011 and 11:
| Align right | Pads the shorter input with leading zeros, the way numbers line up. | 1011 ⊕ 0011 = 1000 |
|---|---|---|
| Align left | Pads it with trailing zeros, so the end of the longer input passes through. | 1011 ⊕ 1100 = 0111 |
| Repeat | Repeats the shorter input to full length, as in a repeating-key cipher. | 1011 ⊕ 1111 = 0100 |
| Truncate | Drops the part of the longer input that has no partner. | 10 ⊕ 11 = 01 |
Results keep their leading zeros, so they are as long as the longest input, or the shortest when truncating. ff00ff ⊕ ff0000 is 0000ff, not ff.
= padding. Like ASCII it needs whole bytes, so other lengths get leading zeros and a note.\x00, \n and \t, and a backslash appears as \\. Turn off escaping to read the bytes as UTF-8 text..xor added or removed, so XORing photo.jpg with a key gives photo.jpg.xor, and XORing that with the same key gives back photo.jpg.The calculation runs on your device. What you type is never sent anywhere or saved, files you open are read by your browser and never uploaded, and the page loads nothing from other sites: no trackers, ads or third-party fonts. Only your format and display choices are remembered, in this browser.
You can check this yourself:
connect-src 'none', which tells your browser to block any connection the page tries to open, and the scripts are plain, readable JavaScript.A share link is the one exception, and only when you make one: it carries your inputs in the link itself, after the #. Browsers never send that part to the server, but anyone you give the link to can read the inputs, and it stays in your browser history.
xor.pw has been calculating XOR since 2013. Until 2026, every calculation went to the server, where PHP’s GMP library did the work. In 2026, Claude, an AI model made by Anthropic, designed and built this version, working with the site’s owner.
This version runs as JavaScript in your browser, and the server only delivers the page. Each input becomes bytes in a Uint8Array, the bytes are combined with JavaScript’s ^ operator, and decimal numbers are converted with BigInt.