Intermediate

XOR Calculator — Bitwise Exclusive OR with Binary View

Compute the bitwise XOR (exclusive OR) of two integers in 4, 8, 16 or 32-bit mode. See the result in decimal, binary and hex, with a step-by-step bit-column view showing exactly which bits differ — the core operation behind bit-toggling, checksums and XOR encryption.
Non-negative integer within the chosen bit width
Non-negative integer within the chosen bit width

Bit width

A XOR B (decimal)
49
A XOR B (hex)
0x31
A XOR B (binary)
00110001
A (binary)
00101010
B (binary)
00011011
Bit-by-bit XOR
1

A

00101010 (42)
2

B

00011011 (27)
3

XOR rule: same bits → 0, different → 1

────────
=

A XOR B

00110001 (49)
0326496128160192224256ABA^BA, B and A XOR B on the number line
परिणाम केवल सामान्य जानकारी के लिए अनुमान हैं और पेशेवर सलाह नहीं हैं — महत्वपूर्ण परिणामों पर भरोसा करने से पहले हमेशा उन्हें स्वतंत्र रूप से सत्यापित करें। पूरा अस्वीकरण पढ़ें.
त्वरित उत्तर

यह कैलकुलेटर कैसे काम करता है?

XOR compares bits pairwise: output is 1 when bits differ, 0 when equal. For example 42 ^ 27 = 49 (00101010 XOR 00011011 = 00110001 in 8-bit). Key properties: A^A=0, A^0=A, and (A^B)^B=A (self-inverting). Used for bit toggling, parity, checksums, and XOR encryption.

सूत्र
A XOR B = A ^ B • Bit rule: 0^0=0, 0^1=1, 1^0=1, 1^1=0 • Key identities: A^A=0, A^0=A
How this is calculated

XOR (exclusive OR) compares each corresponding pair of bits independently: the output bit is 1 if and only if the two input bits differ. When the bits are the same (both 0 or both 1), the output is 0. This makes XOR a self-inverting operation — applying XOR twice with the same key restores the original value: (A ^ B) ^ B = A.

This calculator masks each operand to the chosen bit width (4, 8, 16 or 32 bits) before operating, mirroring the behaviour of fixed-width unsigned integers in C, Rust, Go and most systems languages. Values outside the register range are silently wrapped by the mask. The bit-column step view aligns A, B and the XOR result so you can verify each output bit against the rule directly.

XOR has many practical uses: toggling individual bits in a bitmask (bit ^= (1 << n)), fast in-place integer swapping (a ^= b; b ^= a; a ^= b), computing single-bit parity for error detection, and symmetric key encryption (the one-time pad is XOR with a random key). It is also used extensively in checksums, hash-function mixing, CRC computation and RAID-5 error correction.

अक्सर पूछे जाने वाले प्रश्न

XOR is used for bit toggling (flip a specific bit without affecting others), in-place variable swapping (a ^= b; b ^= a; a ^= b), parity computation (XOR all bytes gives 0 for even-parity), simple encryption and masking, and hash mixing. Key identities: A ^ A = 0 and A ^ 0 = A.

XOR encryption applies the key byte-by-byte: ciphertext = plaintext ^ key. Decryption is identical: plaintext = ciphertext ^ key. If the key is as long as the message and truly random (one-time pad), the cipher is information-theoretically unbreakable. Short or repeated keys are weaker and vulnerable to frequency analysis.

XOR (^) outputs 1 when bits differ. XNOR (equivalence) outputs 1 when bits are the same — it is the bitwise NOT of XOR. XNOR is used in equality comparisons and error-correcting circuits. Most languages lack a dedicated XNOR operator; compute it as ~(A ^ B) masked to the required bit width.

इस नाम से भी जाना जाता है

xor calculator
bitwise xor
exclusive or calculator
xor binary
a xor b calculator
xor bit operation
boolean xor

APA

TG we-Calculate Editorial Team. (2026). XOR Calculator — Bitwise Exclusive OR with Binary View [Online calculator]. TG we-Calculate. https://we-calculate.com/hi/calculator/xor-calculator

Chicago

TG we-Calculate Editorial Team. "XOR Calculator — Bitwise Exclusive OR with Binary View." TG we-Calculate. 2026. https://we-calculate.com/hi/calculator/xor-calculator.

IEEE

TG we-Calculate Editorial Team, "XOR Calculator — Bitwise Exclusive OR with Binary View," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/hi/calculator/xor-calculator

BibTeX

@misc{wecalculate_xor_calculator, title = {XOR Calculator — Bitwise Exclusive OR with Binary View}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/hi/calculator/xor-calculator}}, year = {2026}, note = {TG we-Calculate} }

क्या इस कैलकुलेटर ने आपकी मदद की?

संबंधित कैलकुलेटर