Steroidal glycoalkaloids (SGAs) such as α-solanine found in solanaceous food plants—as, for example, potato—are antinutritional factors for humans. Comparative coexpression analysis between tomato and potato coupled with chemical profiling revealed an array of 10 genes that partake in SGA biosynthesis. We discovered that six of them exist as a cluster on chromosome 7, whereas an additional two are adjacent in a duplicated genomic region on chromosome 12. Following systematic functional analysis, we suggest a revised SGA biosynthetic pathway starting from cholesterol up to the tetrasaccharide moiety linked to the tomato SGA aglycone. Silencing GLYCOALKALOID METABOLISM 4 prevented accumulation of SGAs in potato tubers and tomato fruit. This may provide a means for removal of unsafe, antinutritional substances present in these widely used food crops.