A quantum analog of the fundamental classical NOT gate is a quantum gate that would transform any input qubit state onto an orthogonal state. Intriguingly, this universal NOT gate is forbidden by the laws of quantum physics. This striking phenomenon has far-reaching implications concerning quantum information processing and encoding information about directions and reference frames into quantum states. It also triggers the question under what conditions the preparation of quantum states orthogonal to input states becomes possible. Here we report on experimental demonstration of orthogonalization of partly unknown single- and two-qubit quantum states. A state orthogonal to an input state is conditionally prepared by quantum filtering, and the only required information about the input state is a mean value of a single arbitrary operator. We show that perfect orthogonalization of partly unknown two-qubit entangled states can be performed by applying the quantum filter to one of the qubits only.