Complex three-dimensional biophotonic nanostructures produce the vivid structural colors of many butterfly wing scales, but their exact nanoscale organization is uncertain. We used small angle X-ray scattering (SAXS) on single scales to characterize the 3D photonic nanostructures of five butterfly species from two families (Papilionidae, Lycaenidae). We identify these chitin and air nanostructures as single network gyroid (I4 1 32) photonic crystals. We describe their optical function from SAXS data and photonic band-gap modeling. Butterflies apparently grow these gyroid nanostructures by exploiting the self-organizing physical dynamics of biological lipid-bilayer membranes. These butterfly photonic nanostructures initially develop within scale cells as a core-shell double gyroid (Ia3d), as seen in block-copolymer systems, with a pentacontinuous volume comprised of extracellular space, cell plasma membrane, cellular cytoplasm, smooth endoplasmic reticulum (SER) membrane, and intra-SER lumen. This double gyroid nanostructure is subsequently transformed into a single gyroid network through the deposition of chitin in the extracellular space and the degeneration of the rest of the cell. The butterflies develop the thermodynamically favored double gyroid precursors as a route to the optically more efficient single gyroid nanostructures. Current approaches to photonic crystal engineering also aim to produce single gyroid motifs. The biologically derived photonic nanostructures characterized here may offer a convenient template for producing optical devices based on biomimicry or direct dielectric infiltration.biological meta-materials | organismal color | biomimetics | biological cubic mesophases