Twinning is a common crystallographic phenomenon which is related to the formation and coexistence of several orientation variants of the same crystal structure. It may occur during symmetry-lowering phase transitions or during the crystal growth itself. Once formed, twin domains play an important role in defining physical properties: for example, they underpin the giant piezoelectric effect in ferroelectrics, superelasticity in ferroelastics and the shape-memory effect in martensitic alloys. Regrettably, there is still a lack of experimental methods for the characterization of twin domain patterns. Here, a theoretical framework and algorithm are presented for the recognition of ferroelastic domains, as well as the identification of the coherent twin relationship using high-resolution reciprocal-space mapping of X-ray diffraction intensity around split Bragg peaks. Specifically, the geometrical theory of twinned ferroelastic crystals [Fousek & Janovec (1969). J. Appl. Phys.
40, 135–142] is adapted for the analysis of the X-ray diffraction patterns. The necessary equations are derived and an algorithm is outlined for the calculation of the separation between the Bragg peaks, diffracted from possible coherent twin domains, connected to one another via a mismatch-free interface. It is demonstrated that such separation is always perpendicular to the planar interface between mechanically matched domains. For illustration purposes, the analysis is presented of the separation between the peaks diffracted from tetragonal and rhombohedral domains in the high-resolution reciprocal-space maps of BaTiO3 and PbZr1−x
Ti
x
O3 crystals. The demonstrated method can be used to analyse the response of multi-domain patterns to external perturbations such as electric field, change of temperature or pressure.