Charge density wave (CDW) order appears throughout the underdoped high-temperature cuprate superconductors, but the underlying symmetry breaking and the origin of the CDW remain unclear. We use X-ray diffraction to determine the microscopic structure of the CDWs in an archetypical cuprate YBa2Cu3O6.54 at its superconducting transition temperature ∼ 60 K. We find that the CDWs in this material break the mirror symmetry of the CuO2 bilayers. The ionic displacements in the CDWs have two components, which are perpendicular and parallel to the CuO2 planes, and are out of phase with each other. The planar oxygen atoms have the largest displacements, perpendicular to the CuO2 planes. Our results allow many electronic properties of the underdoped cuprates to be understood. For instance, the CDWs will lead to local variations in the electronic structure, giving an explicit explanation of density-wave states with broken symmetry observed in scanning tunnelling microscopy and soft X-ray measurements.