The lengths of geodesics on hyperbolic surfaces satisfy intriguing equations, known as identities, relating these lengths to geometric quantities of the surface. This paper is about a large family of identities that relate lengths of closed geodesics and orthogeodesics to boundary lengths or number of cusps. These include, as particular cases, identities due to Basmajian, to McShane and to Mirzakhani and Tan-Wong-Zhang. In stark contrast to previous identities, the identities presented here include the lengths taken among all closed geodesics.