As a result of their inherent differences in stability, sand ripples and megaripples exhibit variations in terms of their wavelengths and grain-size distributions (unimodal for sand ripples and bimodal for megaripples). While sand ripples form almost straight lines, megaripples have greater sinuosity due to their transverse instability, a property that causes small megaripple undulations to grow with time. The origin of the instability is due to variations in megaripple height, variations that do not diminish over time, and due to the inverse dependence of ripple drift velocity on the height. Thus, the taller regions of ripples will move more slowly than the adjacent, shorter portions, an outcome that promotes further perturbation growth. We show an example based on field work of the transverse instability of megaripples. The instability growth rate depends on the difference between the heights of the different segments of the megaripple. In contrast to the underlying instability of megaripples, normal sand ripples are essentially stable and are not affected by transverse perturbations, instead reacting quickly to the wind, which tends to smooth ripple height irregularities. The transverse instability of megaripples derives from the composition of their crests, which comprise coarse particles that allow initial perturbations in ripple height to grow further. The results suggest a physical mechanism for the transverse instability of megaripples and new insight into the spatial patterns of sand ripples.