During interphase, the inactive X chromosome (Xi) is largely transcriptionally silent and adopts an unusual 3D configuration known as the "Barr body." Despite the importance of X chromosome inactivation, little is known about this 3D conformation. We recently showed that in humans the Xi chromosome exhibits three structural features, two of which are not shared by other chromosomes. First, like the chromosomes of many species, Xi forms compartments. Second, Xi is partitioned into two huge intervals, called "superdomains," such that pairs of loci in the same superdomain tend to colocalize. The boundary between the superdomains lies near DXZ4, a macrosatellite repeat whose Xi allele extensively binds the protein CCCTC-binding factor. Third, Xi exhibits extremely large loops, up to 77 megabases long, called "superloops." DXZ4 lies at the anchor of several superloops. Here, we combine 3D mapping, microscopy, and genome editing to study the structure of Xi, focusing on the role of DXZ4. We show that superloops and superdomains are conserved across eutherian mammals. By analyzing ligation events involving three or more loci, we demonstrate that DXZ4 and other superloop anchors tend to colocate simultaneously. Finally, we show that deleting DXZ4 on Xi leads to the disappearance of superdomains and superloops, changes in compartmentalization patterns, and changes in the distribution of chromatin marks. Thus, DXZ4 is essential for proper Xi packaging.