The exchange interaction between spins poses considerable challenges for high-fidelity control of semiconductor spin qubits. Here, the authors use pulse optimization and closed-loop control to achieve a gate fidelity of 99.5% for exchange-based single-qubit gates of two-electron spin qubits in GaAs.