A connection-independent formulation of general relativity is presented, in which the dynamics does not depend on the choice of connection. The gravity action in this formulation includes one additional scalar term in addition to the Einstein-Hilbert action. No conditions on the connection are imposed. Nevertheless, this formulation yields the Einstein equations, without adding the Gibbons-Hawking-York term even when a manifold has a boundary. Furthermore, this formulation yields a unified description of general relativity, teleparallel gravity, and symmetric teleparallel gravity.