Quantum error correction and symmetry arise in many areas of physics, including many-body systems, metrology in the presence of noise, fault-tolerant computation, and holographic quantum gravity. Here, we study the compatibility of these two important principles. If a logical quantum system is encoded into n physical subsystems, we say that the code is covariant with respect to a symmetry group G if a G transformation on the logical system can be realized by performing transformations on the individual subsystems. For a G-covariant code with G a continuous group, we derive a lower bound on the error-correction infidelity following erasure of a subsystem. This bound approaches zero when the number of subsystems nor the dimension d of each subsystem is large. We exhibit codes achieving approximately the same scaling of infidelity with n or d as the lower bound. Leveraging tools from representation theory, we prove an approximate version of the Eastin-Knill theorem for quantum computation: If a code admits a universal set of transversal gates and corrects erasure with fixed accuracy, then, for each logical qubit, we need a number of physical qubits per subsystem that is inversely proportional to the error parameter. We construct codes covariant with respect to the full logical unitary group, achieving good accuracy for large d (using random codes) or n (using codes based on W states). We systematically construct codes covariant with respect to general groups, obtaining natural generalizations of qubit codes to, for instance, oscillators and rotors. In the context of the AdS/CFT correspondence, our approach provides insight into how time evolution in the bulk corresponds to time evolution on the boundary without violating the Eastin-Knill theorem, and our five-rotor code can be stacked to form a covariant holographic code.