QSandbox

Live Code-to-Circuit Converter

OpenQASM 2.0 to Circuit Visualizer

Paste OpenQASM 2.0 quantum code from Qiskit or textbooks and instantly inspect the circuit diagram, 3D Bloch sphere, and 1,000 simulated measurement shots.

OpenQASM 2.0 Code

2Q · 4 gates

Quick append line

Visual Circuit Diagram

Click any gate to remove it, or select a gate below and click an empty slot.

Wires

Measurement Probabilities

Outcome probabilities
|00⟩
50.0%
|01⟩
0.0%
|10⟩
0.0%
|11⟩
50.0%

3D Bloch Sphere (q[0])

Loading Bloch Sphere…

Supported OpenQASM 2.0 Syntax Reference

qreg q[2];

Declare a register of 2 to 4 qubits.

h q[0];

Apply Hadamard superposition gate on qubit 0.

x / y / z q[0];

Apply Pauli bit-flip or phase rotation gates.

s / t q[0];

Apply 90° (S) or 45° (T) phase shifts.

cx q[0],q[1];

Entangle control qubit 0 with target qubit 1 (CNOT).

measure q[0] -> c[0];

Add readout marker for qubit 0.