Genetic factors can cause recurrent abnormal synchronization and episodic hyperexcitability of neuronal networks through various mechanisms. Many of the genes that have been implicated in idiopathic epilepsies code for ion channels, whereas syndromes with epilepsy as a main feature are caused by genes that are involved in functions as diverse as cortical development, mitochondrial function and cell metabolism. Each 'epilepsy gene' that is identified provides new and fascinating insights into the molecular basis of neuronal excitability and brain function.