We experimentally demonstrate an optical controlled-NOT (CNOT) gate with arbitrary single inputs based on a 4-photon 6-qubit cluster state entangled both in polarization and spatial modes. We first generate the 6-qubit state, and then, by performing single-qubit measurements, the CNOT gate is applied to arbitrary single input qubits. To characterize the performance of the gate, we estimate its quantum process fidelity and prove its entangling capability. In addition, our results show that the gate cannot be reproduced by local operations and classical communication. Our experiment shows that such hyper-entangled cluster states are promising candidates for efficient optical quantum computation.