XOR (exclusive OR) returns true when inputs differ. If both are true or both are false, XOR returns false. Mathematically: .
Many languages lack a boolean XOR operator but have bitwise XOR (^). For booleans, you can write (a || b) && !(a && b) or a != b.
Example: canEdit XOR canDelete means you have exactly one permission, not both, not neither. XOR is less common than AND/OR but appears in parity checks and toggle logic.