Robust quantum computation requires encoding delicate quantum information into degrees of freedom that are hard for the environment to change. Quantum encodings have been demonstrated in many physical systems by observing and correcting storage errors, but applications require not just storing information; we must accurately compute even with faulty operations. The theory of faulttolerant quantum computing illuminates a way forward by providing a foundation and collection of techniques for limiting the spread of errors. Here we implement one of the smallest quantum codes in a five-qubit superconducting transmon device and demonstrate fault-tolerant state preparation. We characterize the resulting codewords through quantum process tomography and study the free evolution of the logical observables. Our results are consistent with fault-tolerant state preparation in a protected qubit subspace.The possibility of robust quantum computation rests on the fact that quantum information can be encoded in degrees of freedom that are difficult for local noise processes to change. Quantum codes with this potential have been demonstrated in many physical systems [1][2][3][4][5][6][7][8][9][10]. To make practical use of these codes, however, it is necessary not only to encode, decode, and observe errors, but to compute with faulty and inaccurate operations in a way that does not spread errors. The well-developed theory of fault-tolerant quantum computing reveals a steep experimental path toward this goal [11,12]. Recently, the question of what constitutes a minimal experimental demonstration of fault-tolerance was considered [13]. Fault-tolerant state preparation was demonstrated soon thereafter using a quantum error detecting code with trapped atomic ions [14]. Here we go beyond that result, implementing fault-tolerant state preparation on a superconducting qubit system with supporting evidence including quantum state tomography of prepared codewords, acceptance and logical error probabilities with and without error insertion, and analysis of the measured logical observables under free evolution.We implement one of the smallest quantum codes, a four qubit code encoding two qubits [15], and characterize output states produced by fault-tolerant state preparation circuits. The circuits are fault-tolerant for only one of the two encoded qubits, which allows direct comparison of their error rates. The circuits are applied in a five-qubit transmon device with nearest-neighbor connectivity. This device is a nontrivial subset of a surface code lattice in the sense that it provides resources for detection of any single-qubit error. Although the connectivity and size places limits on the set of fault-tolerant circuits we can implement on the four-qubit code, we can use stabilizer measurements to prepare codewords in a way that is analogous to surface code state preparation.Four qubit code -The four-qubit code [15] encodes two logical qubits into four physical qubits and can detect any error that acts on one of those physical qubits. It...